Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2002 19:01:13 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern uipc_socket.c
Message-ID:  <XFMail.20020528190113.jhb@FreeBSD.org>
In-Reply-To: <200205282251.g4SMpk6g008704@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On 28-May-2002 Garrett Wollman wrote:
> <<On Tue, 28 May 2002 14:55:45 -0400 (EDT), John Baldwin <jhb@FreeBSD.org> said:
> 
>> We allocate a new socket, with _NO_ other references to it from anyone else.
> 
> There is no guarantee that there are no other references to it, since
> it is possible for the socket to be recycled in between the time it is
> marked for export by the sysctl helper function and the time it is
> actually copied out.  The zone allocator recycled objects in FIFO
> order; I'm not sure what the behavior of UMA is in this regard.

UMA only gives us a socket that has been uma_zfree()'d.  The sysctl
helper should gain a reference to each socket while holding an appropriate
lock on the list before the copyout and drop it around the copyout if
it is not doing so already.  If it does that then a socket won't be
free'd out from under the sysctl function.  This is not all that unusual
of a race and if this is the one you are talking about it should be
documented in the sysctl helper where the fix will need to be applied,
not in soalloc().

> -GAWollman

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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