From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 10 09:36:59 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5942D1065675; Tue, 10 Feb 2009 09:36:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 48F618FC19; Tue, 10 Feb 2009 09:36:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from freefall.freebsd.org (rwatson@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1A9awI8071673; Tue, 10 Feb 2009 09:36:58 GMT (envelope-from rwatson@freefall.freebsd.org) Received: (from rwatson@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1A9awXI071669; Tue, 10 Feb 2009 09:36:58 GMT (envelope-from rwatson) Date: Tue, 10 Feb 2009 09:36:58 GMT Message-Id: <200902100936.n1A9awXI071669@freefall.freebsd.org> To: shcheklein@gmail.com, rwatson@FreeBSD.org, freebsd-bugs@FreeBSD.org, rwatson@FreeBSD.org From: rwatson@FreeBSD.org Cc: Subject: Re: kern/130348: [socket] accept() prematurely allocates an inheritable descriptor X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2009 09:36:59 -0000 Synopsis: [socket] accept() prematurely allocates an inheritable descriptor State-Changed-From-To: open->analyzed State-Changed-By: rwatson State-Changed-When: Tue Feb 10 09:33:38 UTC 2009 State-Changed-Why: This race condition is inherent to all system calls that allocate file descriptors, especially where file descriptor allocation may block (such as open with O_EXLOCK, open on a fifo, etc) -- threaded user application must synchronize around such calls to deterministically prevent this result. However, I will review both the code and other operating systems to see whether (a) this application race can be narrowed without affecting performance/ reliability, and (b) other systems provide a fix or workaround such that portable applications might expect not to see this race. Responsible-Changed-From-To: freebsd-bugs->rwatson Responsible-Changed-By: rwatson Responsible-Changed-When: Tue Feb 10 09:33:38 UTC 2009 Responsible-Changed-Why: Grab ownership. http://www.freebsd.org/cgi/query-pr.cgi?pr=130348