Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-16 Thread David Miller
From: Rainer Weikusat Date: Thu, 11 Feb 2016 19:37:27 + > The unix_dgram_sendmsg routine use the following test > > if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { > > to determine if sk and other are in an n:1 association (either > established via connect or by using send

Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-12 Thread Rainer Weikusat
Ben Hutchings writes: > On Fri, 2016-02-12 at 20:17 +, Rainer Weikusat wrote: [...] I don't think this should apply when receiving and sending sockets are identical. But that's just my opinion. The other option would be to avoid the unix_state_double_lock for sk == other.

Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-12 Thread Ben Hutchings
On Fri, 2016-02-12 at 20:17 +, Rainer Weikusat wrote: > Ben Hutchings writes: > > On Fri, 2016-02-12 at 13:25 +, Rainer Weikusat wrote: > > > Philipp Hahn writes: > > > > Hello Rainer, > > > > > > > > Am 11.02.2016 um 20:37 schrieb Rainer Weikusat: > > > > > The unix_dgram_sendmsg routin

Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-12 Thread Rainer Weikusat
Ben Hutchings writes: > On Fri, 2016-02-12 at 13:25 +, Rainer Weikusat wrote: >> Philipp Hahn writes: >> > Hello Rainer, >> > >> > Am 11.02.2016 um 20:37 schrieb Rainer Weikusat: >> > > The unix_dgram_sendmsg routine use the following test >> > > >> > > if (unlikely(unix_peer(other) != sk &

Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-12 Thread Ben Hutchings
On Fri, 2016-02-12 at 13:25 +, Rainer Weikusat wrote: > Philipp Hahn writes: > > > Hello Rainer, > > > > Am 11.02.2016 um 20:37 schrieb Rainer Weikusat: > > > The unix_dgram_sendmsg routine use the following test > > > > > > if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) {

Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-12 Thread Rainer Weikusat
Philipp Hahn writes: > Hello Rainer, > > Am 11.02.2016 um 20:37 schrieb Rainer Weikusat: >> The unix_dgram_sendmsg routine use the following test >> >> if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { [...] >> This isn't correct as the> specified address could have been bound

Re: [PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-12 Thread Philipp Hahn
Hello Rainer, Am 11.02.2016 um 20:37 schrieb Rainer Weikusat: > The unix_dgram_sendmsg routine use the following test > > if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { > > to determine if sk and other are in an n:1 association (either > established via connect or by using sen

[PATCH net] af_unix: Guard against other == sk in unix_dgram_sendmsg

2016-02-11 Thread Rainer Weikusat
The unix_dgram_sendmsg routine use the following test if (unlikely(unix_peer(other) != sk && unix_recvq_full(other))) { to determine if sk and other are in an n:1 association (either established via connect or by using sendto to send messages to an unrelated socket identified by address). This is