--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: ocamlnet: Sets FD_CLOEXEC incorrectly with F_SETFL instead of F_SETFD
- From: Guillem Jover <guillem@debian.org>
- Date: Tue, 18 Dec 2012 23:03:18 +0100
- Message-id: <20121218220317.GA28649@gaara.hadrons.org>
Source: ocamlnet
Version: 3.5.1-1
Severity: important
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: fcntl-fd-cloexec
Hi!
This package contains code that tries to set the FD_CLOEXEC flag for a
file descriptor, but it does using F_SETFL instead of F_SETFD.
Using that value on F_SETFL is just wrong, and might make the call fail
on some systems, as it's requesting to set an undetermined flag. For
example on GNU/* FD_CLOEXEC has value 1, which matches with O_WRONLY.
This might cause the code to at least leak file descriptors, and at
worst to terminate execution.
Attached a patch fixing this.
Thanks,
Guillem
From 7c7af1cd47b577dda2f38755e367632f8a73c4b1 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Tue, 18 Dec 2012 18:25:47 +0100
Subject: [PATCH] ocamlnet: Set FD_CLOEXEC correctly using F_SETFD not F_SETFL
Using that value on F_SETFL is just wrong, and might make the call fail
on some systems, as it's requesting to set an undetermined flag. For
example on GNU/* FD_CLOEXEC has value 1, which matches with O_WRONLY.
This might cause the code to at least leak file descriptors, and at worst
to terminate execution.
---
src/netsys/netsys_c_poll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/netsys/netsys_c_poll.c b/src/netsys/netsys_c_poll.c
index d9f67df..bc680e7 100644
--- a/src/netsys/netsys_c_poll.c
+++ b/src/netsys/netsys_c_poll.c
@@ -218,7 +218,7 @@ CAMLprim value netsys_create_event_aggreg(value cancelv)
#ifdef HAVE_EPOLL
fd = epoll_create(128);
if (fd == -1) uerror("epoll_create", Nothing);
- code = fcntl(fd, F_SETFL, FD_CLOEXEC);
+ code = fcntl(fd, F_SETFD, FD_CLOEXEC);
if (code == -1) {
e = errno;
close(fd);
@@ -238,7 +238,7 @@ CAMLprim value netsys_create_event_aggreg(value cancelv)
close(fd);
unix_error(e, "eventfd", Nothing);
};
- code = fcntl(cancel_fd, F_SETFL, FD_CLOEXEC);
+ code = fcntl(cancel_fd, F_SETFD, FD_CLOEXEC);
if (code == -1) {
e = errno;
close(fd);
--
1.8.1.rc0
--- End Message ---
--- Begin Message ---
Source: ocamlnet
Source-Version: 3.5.1-2
We believe that the bug you reported is fixed in the latest version of
ocamlnet, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 696279@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Stéphane Glondu <glondu@debian.org> (supplier of updated ocamlnet package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Wed, 05 Jun 2013 08:03:53 +0200
Source: ocamlnet
Binary: libocamlnet-ocaml-dev libocamlnet-ocaml libocamlnet-ocaml-bin libocamlnet-gtk2-ocaml-dev libocamlnet-ssl-ocaml-dev libocamlnet-ssl-ocaml libnethttpd-ocaml-dev libapache2-mod-ocamlnet libocamlnet-ocaml-doc
Architecture: source amd64 all
Version: 3.5.1-2
Distribution: unstable
Urgency: low
Maintainer: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Changed-By: Stéphane Glondu <glondu@debian.org>
Description:
libapache2-mod-ocamlnet - OCaml application-level Internet libraries - netcgi2 Apache2 conn
libnethttpd-ocaml-dev - OCaml application-level Internet libraries - HTTP daemon developm
libocamlnet-gtk2-ocaml-dev - OCaml application-level Internet libraries - GTK2 development lib
libocamlnet-ocaml - OCaml application-level Internet libraries - core runtime librari
libocamlnet-ocaml-bin - OCaml application-level Internet libraries - binaries
libocamlnet-ocaml-dev - OCaml application-level Internet libraries - core development lib
libocamlnet-ocaml-doc - OCaml application-level Internet libraries - documentation and ex
libocamlnet-ssl-ocaml - OCaml application-level Internet libraries - SSL runtime librarie
libocamlnet-ssl-ocaml-dev - OCaml application-level Internet libraries - SSL development libr
Closes: 666825 696279
Changes:
ocamlnet (3.5.1-2) unstable; urgency=low
.
* Update packaging for apache 2.4 (Closes: #666825)
- import upstream patch to fix compilation
* Fix incorrect use of F_SETFL with FD_CLOEXEC (Closes: #696279)
* Force all netsys features on Linux (LP: #257524)
* Bump debhelper compat level to 9
* Update Vcs-* fields
Checksums-Sha1:
7f6704c12a87e510950027ef23621eb83202b04f 2808 ocamlnet_3.5.1-2.dsc
0dbf32e89cac6e7c3e1e527ed7dda2c98454e5ba 17108 ocamlnet_3.5.1-2.debian.tar.gz
5d101790f6f1cebaeff391463d52d56215cbac6d 12351466 libocamlnet-ocaml-dev_3.5.1-2_amd64.deb
afe6db290bfc0f456f931ce03f86c29e2cd32353 53576 libocamlnet-ocaml_3.5.1-2_amd64.deb
4f869561a6b1c903337f4c62dfe67a0f49f115e2 520848 libocamlnet-ocaml-bin_3.5.1-2_amd64.deb
59e1e6226b065b0fcfec7f74a0c7263cdb05b5a2 48890 libocamlnet-gtk2-ocaml-dev_3.5.1-2_amd64.deb
781f887e085ec3a492fde0860b030a1858b43938 163278 libocamlnet-ssl-ocaml-dev_3.5.1-2_amd64.deb
2c2365cf42c996196a8bfd6aad2e3066d2f7ab10 20306 libocamlnet-ssl-ocaml_3.5.1-2_amd64.deb
a09a0b22980c6b74d78778b8039c7d70dffc04d4 987094 libnethttpd-ocaml-dev_3.5.1-2_amd64.deb
d62c40e90da167aeef89b535e8074f3bb3e6302d 144562 libapache2-mod-ocamlnet_3.5.1-2_amd64.deb
0e57f31f7bcc2866746c58ec4ae93299af356a1f 1733130 libocamlnet-ocaml-doc_3.5.1-2_all.deb
Checksums-Sha256:
b292bfcb80bc5d897dca0b15f481ebb5269540a1cbe33c6ea6e3ffdee4593dcf 2808 ocamlnet_3.5.1-2.dsc
ff4eeadc4529a3f1c2485c1dda32e64c1b24fe22f8c97541ea1712ecf42a98e3 17108 ocamlnet_3.5.1-2.debian.tar.gz
f6e07b44a1ccfa8f112693ed9c2254d5acf5a3d8320884b4ab4e8521a4ad49bf 12351466 libocamlnet-ocaml-dev_3.5.1-2_amd64.deb
f89869d59e70580633bc3cc3a49ed1379b1b9dcd15d7a34ef28864973f61644a 53576 libocamlnet-ocaml_3.5.1-2_amd64.deb
47b2695f454e511ba6da2da532f89b1cf467d19b18892017444652ead2217b03 520848 libocamlnet-ocaml-bin_3.5.1-2_amd64.deb
568365b5615064dcc2af7ce40af21dd02f8d8e9d5b60d40ec29c136fb9e68c06 48890 libocamlnet-gtk2-ocaml-dev_3.5.1-2_amd64.deb
5e1388774a251e8ca23ac8ab5fb8215573ec63727aabbcda833cf5947377838d 163278 libocamlnet-ssl-ocaml-dev_3.5.1-2_amd64.deb
11878ff9ad3ebec197e43f7ea76166e7da8e44c834653043c244d13ade06c282 20306 libocamlnet-ssl-ocaml_3.5.1-2_amd64.deb
e7a3f2792d3ba7e482552581c2c31af9b6fc3bb891a159d63d5bbe98473904bd 987094 libnethttpd-ocaml-dev_3.5.1-2_amd64.deb
16638f8d8dc936310e2ead2e8b40fe4d2b0426aad1bffbfa4751e439c31b23bd 144562 libapache2-mod-ocamlnet_3.5.1-2_amd64.deb
cf7a1e06189a6533df833eb3ada2f08e7aa8492a18f99325d83037e659a25ed4 1733130 libocamlnet-ocaml-doc_3.5.1-2_all.deb
Files:
68730247acb597ce8464ed8e3ff91066 2808 ocaml optional ocamlnet_3.5.1-2.dsc
d37141d6a697971c0a67401dd733b094 17108 ocaml optional ocamlnet_3.5.1-2.debian.tar.gz
97b0a08f4391fb6f9b88094d6b900822 12351466 ocaml optional libocamlnet-ocaml-dev_3.5.1-2_amd64.deb
26754a1ac46602721baff5c3ee724eb8 53576 ocaml optional libocamlnet-ocaml_3.5.1-2_amd64.deb
db35a013f1822a640ee45dcbb95de558 520848 ocaml optional libocamlnet-ocaml-bin_3.5.1-2_amd64.deb
a321ef59538dc5163945751bf148bd82 48890 ocaml optional libocamlnet-gtk2-ocaml-dev_3.5.1-2_amd64.deb
3e33f5f27cfacc8f00ffe5155805fb4d 163278 ocaml optional libocamlnet-ssl-ocaml-dev_3.5.1-2_amd64.deb
e8e40ab8b8fc9fd26f3c3036b1be42a2 20306 ocaml optional libocamlnet-ssl-ocaml_3.5.1-2_amd64.deb
8cfd3cd6044d44493b6a09de8c8e78e8 987094 ocaml optional libnethttpd-ocaml-dev_3.5.1-2_amd64.deb
32354af84e5f044e58fa0165fade89ee 144562 httpd optional libapache2-mod-ocamlnet_3.5.1-2_amd64.deb
52c150c084a5fa88a0142b2f9d9f77a0 1733130 doc optional libocamlnet-ocaml-doc_3.5.1-2_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBCgAGBQJRrt+xAAoJEHhT2k1JiBrT7EkP/iCPRvGtQ4JhVn548sMk0oS5
I2hfdHbo+ayoJeeoKavQGZ7aEE+niH9F6zyll88vnWGlxH/6cs3JoW6GuyaLKbpf
cEq3oxZmmVeMz19C8FdoXe0evzBXuJXNUxgwHp9I8U+tzZLJbZ8TKs+MD5JFUz9G
qKGOHvsOIhaWpYiK3NCumfS5c/V6NWA3MVZz2Id/Gf0YM2OlulI+vGPqtG/+2Et9
zUy2y5tpGXHlGxWdC6hPK9584KSVDMwfmiVsgyHQOeoAQDgA/wbdK0c5dkYVuKfp
XwPZ5leqPBOVJvIsEzxTyjUTCOmbazWuhp8EPnHdLiuGlwOxrMZis+nTTlSmpD4T
jJSzlHkPRJvS1zgYZIyB4uq24duK62Y2XcowSo1J/i6bbGLJ/e3BsiL1wgDCmuFT
kw4flPaXfi4U/gNXF64Wqj53RbUQ2AWXoMcbf0WqybMlTLVDpV4wizeoTgIcwKjY
5UuUH4VQS+FTYdOUvYEvyjJ46869m8445luO9yz1hPWDjNzu4kgNgOdzrMhYJ2zO
RB3CiPMx702M/NsD5OsiUf9F7WTNXINi4JjLpIv0C+sPhy9x/yFwxsaCfexb+mFp
hmAoe492ghCCe6XH/+QkCt0xeJmO8mXjzOpV2v7wAiroiz0R8Zr+OtNnDOsbgDo8
LSCXrJ8myYfkP5uSRxFK
=xw7o
-----END PGP SIGNATURE-----
--- End Message ---