Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2009 14:26:42 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Dmitry Chagin <dchagin@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r193165 - head/sys/compat/linux
Message-ID:  <20090531122642.GA18020@stack.nl>
In-Reply-To: <200905311204.n4VC41GR042549@svn.freebsd.org>
References:  <200905311204.n4VC41GR042549@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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

> Log:
>   Move new socket flags handling into a separate function as Linux
>   introduced more syscalls which uses these flags.

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.

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.

That could be fairly complicated and it is a pretty rare situation,
however.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090531122642.GA18020>