From owner-freebsd-bugs@FreeBSD.ORG Thu Feb 12 08:13:54 2009 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D76E1106566B for ; Thu, 12 Feb 2009 08:13:54 +0000 (UTC) (envelope-from shcheklein@gmail.com) Received: from mail-bw0-f170.google.com (mail-bw0-f170.google.com [209.85.218.170]) by mx1.freebsd.org (Postfix) with ESMTP id 365E78FC28 for ; Thu, 12 Feb 2009 08:13:53 +0000 (UTC) (envelope-from shcheklein@gmail.com) Received: by bwz18 with SMTP id 18so1021162bwz.19 for ; Thu, 12 Feb 2009 00:13:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=1MAaJYn7KI6sXIhoOKB93yFJbZk8GiJlte3ZwEVDZGU=; b=ioCNXJNF0wQvPsP7fRLcca/04XPXuD8vM6960WlMcPgRxmWbT37bter/ttroqHvjmD Cl+d6JYyaQ5L2Ctx1zZI0xmoaTqTL+bl3n0QJ0ljlxfV8b02r0DCBretGuXx3HL3QNIv U8uAnYiNjXS2ylQCB+WoEodpZVFz1dsDbltbA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AwgB3dsTim8qb8RGbvYekQNLxaA2FFUL1T2XEQoYF+37kU1Uk3lY4Pnw+7dmGNOHT8 KT27qI0j9axoelZb1aUCSNQctUWlOzsGQoGkbe8nIr6EaGEtgetyuy0iWPuictYUhyiW gcQD+SvQ9otw2qlNyI3pS5/cogbfUbJsqNs1A= MIME-Version: 1.0 Received: by 10.223.121.6 with SMTP id f6mr366186far.77.1234424752964; Wed, 11 Feb 2009 23:45:52 -0800 (PST) In-Reply-To: <200902111540.n1BFeCJ5068985@freefall.freebsd.org> References: <200902111540.n1BFeCJ5068985@freefall.freebsd.org> Date: Thu, 12 Feb 2009 10:45:52 +0300 Message-ID: <3034886f0902112345nfae93e6i55489dd3fb6cd7c7@mail.gmail.com> From: Ivan Shcheklein To: freebsd-bugs@freebsd.org, rwatson@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: kern/130348: [socket] accept() prematurely allocates an inheritable descriptor [regression] 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: Thu, 12 Feb 2009 08:13:55 -0000 On Wed, Feb 11, 2009 at 6:40 PM, wrote: > Synopsis: [socket] accept() prematurely allocates an inheritable descriptor > [regression] > > State-Changed-From-To: analyzed->patched > State-Changed-By: rwatson > State-Changed-When: Wed Feb 11 15:38:28 UTC 2009 > State-Changed-Why: > Fix committed to 8.x; transition to patched until MFC. > > Hi Ivan: > > Thanks for this bug report; per commentary in the commit and the PR, there > is an unavoidable race here due to the nature of the API, but I have made > a change to our fork(2) code so that it is quite a narrow race (consistent > with that found previously on FreeBSD and on other platforms) rather than > a wide one. I will merge this fix to 7.x in a week or so once it has > settled. If you're able to apply the patch manually to your local tree > and confirm it fixes the problem you were seeing, that would be helpful. > > Thanks, > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=130348 > Works fine on 7.1. Thank you, Robert. Also, I think we will use select() to avoid this race condition at all.