lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 21 May 2015 01:47:49 +0200
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/4] net: af_unix: implement stream sendpage support

On Thu, May 21, 2015, at 01:21, Eric Dumazet wrote:
> On Wed, 2015-05-20 at 17:35 +0200, Hannes Frederic Sowa wrote:
> > This patch implements sendpage support for AF_UNIX SOCK_STREAM
> > +
> > +	if (newskb)
> > +		skb_queue_tail(&other->sk_receive_queue, newskb);
> 
> Are you sure we need the skb_queue_tail() here (taking spinlock) ?
> 
> This would tell us there might be a possible race.
> 
> A comment would be nice eventually.

Hmm, at first sight, I think we can change this to __skb_queue_tail.
sendpage does take state_lock and readlock mutex and thus blocks out
both, recvmsg and sendmsg. unix_stream_connect is also serialized by
state_lock.

I guess I used it because of unix_stream_sendmsg, where it is actually
necessary, as recvmsg does unlink skb without state_lock and sendmsg
doesn't hold reader mutex.

Thanks for the hint!

Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ