Re: [PATCH v3] net/unix: sk_socket can disappear when state is unlocked

2015-05-26 Thread David Miller
From: Hannes Frederic Sowa Date: Tue, 26 May 2015 23:24:59 +0200 > On Tue, May 26, 2015, at 17:22, Mark Salyzyn wrote: >> got a rare NULL pointer dereference in clear_bit >> >> Signed-off-by: Mark Salyzyn > > IMHO, this is the right approach, I didn't came up with something > easier, thanks! >

Re: [PATCH v3] net/unix: sk_socket can disappear when state is unlocked

2015-05-26 Thread Hannes Frederic Sowa
Hi, On Tue, May 26, 2015, at 17:22, Mark Salyzyn wrote: > got a rare NULL pointer dereference in clear_bit > > Signed-off-by: Mark Salyzyn IMHO, this is the right approach, I didn't came up with something easier, thanks! Acked-by: Hannes Frederic Sowa -- To unsubscribe from this list: send th

[PATCH v3] net/unix: sk_socket can disappear when state is unlocked

2015-05-26 Thread Mark Salyzyn
got a rare NULL pointer dereference in clear_bit Signed-off-by: Mark Salyzyn v2: switch to sock_flag(sk, SOCK_DEAD) and added net/caif/caif_socket.c v3: return -ECONNRESET in upstream caller of wait function for SOCK_DEAD --- net/caif/caif_socket.c | 8 net/unix/af_unix.c | 8 +

Re: net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Mark Salyzyn
On 05/22/2015 11:16 AM, Hannes Frederic Sowa wrote: On Fri, May 22, 2015, at 18:24, Mark Salyzyn wrote: On 05/22/2015 08:35 AM, Hannes Frederic Sowa wrote: I still wonder if we need to actually recheck the condition and not simply break out of unix_stream_data_wait: We return to the unix_strea

Re: net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Hannes Frederic Sowa
On Fri, May 22, 2015, at 18:24, Mark Salyzyn wrote: > On 05/22/2015 08:35 AM, Hannes Frederic Sowa wrote: > > I still wonder if we need to actually recheck the condition and not > > simply break out of unix_stream_data_wait: > > > > We return to the unix_stream_recvmsg loop and recheck the > > sk_r

Re: net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Mark Salyzyn
On 05/22/2015 08:35 AM, Hannes Frederic Sowa wrote: I still wonder if we need to actually recheck the condition and not simply break out of unix_stream_data_wait: We return to the unix_stream_recvmsg loop and recheck the sk_receive_queue. At this point sk_receive_queue is not really protected wi

Re: net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Hannes Frederic Sowa
On Fr, 2015-05-22 at 07:51 -0700, Mark Salyzyn wrote: > On 05/22/2015 02:50 AM, Hannes Frederic Sowa wrote: > > On Do, 2015-05-21 at 09:25 -0700, Mark Salyzyn wrote: > >> got a rare NULL pointer dereference in clear_bit > >> > >> Signed-off-by: Mark Salyzyn > >> --- > >> net/unix/af_unix.c | 5 +

[PATCH v2] net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Mark Salyzyn
got a rare NULL pointer dereference in clear_bit Signed-off-by: Mark Salyzyn v2: switch to sock_flag(sk, SOCK_DEAD) and added net/caif/caif_socket.c net/caif/caif_socket.c | 4 net/unix/af_unix.c | 4 2 files changed, 8 insertions(+) diff --git a/net/caif/caif_socket.c b/net

Re: net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Mark Salyzyn
On 05/22/2015 02:50 AM, Hannes Frederic Sowa wrote: On Do, 2015-05-21 at 09:25 -0700, Mark Salyzyn wrote: got a rare NULL pointer dereference in clear_bit Signed-off-by: Mark Salyzyn --- net/unix/af_unix.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/unix/af_unix.c b/net/uni

Re: net/unix: sk_socket can disappear when state is unlocked

2015-05-22 Thread Hannes Frederic Sowa
On Do, 2015-05-21 at 09:25 -0700, Mark Salyzyn wrote: > got a rare NULL pointer dereference in clear_bit > > Signed-off-by: Mark Salyzyn > --- > net/unix/af_unix.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c > index 5266ea7..37a8925 1006

net/unix: sk_socket can disappear when state is unlocked

2015-05-21 Thread Mark Salyzyn
got a rare NULL pointer dereference in clear_bit Signed-off-by: Mark Salyzyn --- net/unix/af_unix.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 5266ea7..37a8925 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1880,6 +1880,11