Re: HEADS UP: socket and pcb reference changes entering tree today

From: Robert Watson <rwatson_at_FreeBSD.org>
Date: Sun, 21 May 2006 19:04:57 +0100 (BST)
On Sun, 21 May 2006, Maxim Konovalov wrote:

>> This looks good in terms of pcb structure, but you should acquire SOCK_LOCK 
>> around the so_state manipulation.  To prevent races, I suggest doing it 
>> while also holding the INP lock in the center of the locking sets from the 
>> inpcb. There are some other remaining bugs in the raw socket code elsewhere 
>> also, I think.
>
> I "copied" this code from udp_usrreq.c::udp_disconnect().  There is no such 
> lock.  Is it a bug too?

Yes.

I have some intuitions about why the datagram protocols manually frob the 
disconnected flag rather than calling soisdisconnected(), but am generally 
unsure that this is the right thing.

Robert N M Watson
Received on Sun May 21 2006 - 16:04:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:56 UTC