From owner-svn-src-all@FreeBSD.ORG Sun May 31 12:27:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BE41106566B; Sun, 31 May 2009 12:27:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 59D078FC22; Sun, 31 May 2009 12:27:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: by mx1.stack.nl (Postfix, from userid 65534) id BEC3E359934; Sun, 31 May 2009 14:27:00 +0200 (CEST) X-Spam-DCC: sonic.net: scanner01.stack.nl 1117; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on scanner01.stack.nl X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Relay-Country: _RELAYCOUNTRY_ Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 4A53835994C; Sun, 31 May 2009 14:26:55 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id A15FF228BC; Sun, 31 May 2009 14:26:42 +0200 (CEST) Date: Sun, 31 May 2009 14:26:42 +0200 From: Jilles Tjoelker To: Dmitry Chagin Message-ID: <20090531122642.GA18020@stack.nl> References: <200905311204.n4VC41GR042549@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200905311204.n4VC41GR042549@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193165 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 12:27:02 -0000 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