Date: Sun, 31 May 2009 15:45:55 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Jilles Tjoelker <jilles@stack.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dmitry Chagin <dchagin@freebsd.org> Subject: Re: svn commit: r193165 - head/sys/compat/linux Message-ID: <20090531124555.GT1927@deviant.kiev.zoral.com.ua> In-Reply-To: <20090531122642.GA18020@stack.nl> References: <200905311204.n4VC41GR042549@svn.freebsd.org> <20090531122642.GA18020@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
--KRI42z441+znMDe3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 31, 2009 at 02:26:42PM +0200, Jilles Tjoelker wrote: > On Sun, May 31, 2009 at 12:04:01PM +0000, Dmitry Chagin wrote: > > Author: dchagin > > Date: Sun May 31 12:04:01 2009 > > New Revision: 193165 > > URL: http://svn.freebsd.org/changeset/base/193165 >=20 > > Log: > > Move new socket flags handling into a separate function as Linux > > introduced more syscalls which uses these flags. >=20 > I think this does not fulfill the purpose of LINUX_SOCK_CLOEXEC exactly: > if another thread forks and execs at the wrong time, it may inherit the > socket without the CLOEXEC flag set. >=20 > The obvious way to fix this is to implement SOCK_CLOEXEC in the native > syscalls, in such a way that other threads can never see the new fd > without the CLOEXEC flag set. >=20 > That could be fairly complicated and it is a pretty rare situation, > however. This is well-known issue, that is omnipresent in the linuxolator. Your analysis is right, but until we implement corresponding facilities for the native ABI, linuxolator will be in is this state. Whether we really need to do the work for freebsd binaries is debatable. For the typical case, see linux_common_open().=20 --KRI42z441+znMDe3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkoifAMACgkQC3+MBN1Mb4heEACdHjkX04k1V/l0phjSPK6S6p+P AQIAoJ7GE0IugwNr9shxAUJsslek2z+G =YiZx -----END PGP SIGNATURE----- --KRI42z441+znMDe3--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090531124555.GT1927>