kern/130348: [socket] accept() prematurely allocates an inheritable descriptor [regression]

Ivan Shcheklein shcheklein at gmail.com
Thu Feb 12 00:13:55 PST 2009


On Wed, Feb 11, 2009 at 6:40 PM, <rwatson at freebsd.org> 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.


More information about the freebsd-bugs mailing list