Skip to contentSkip to conversation

net: ip, diag -- Adjust raw_abort to use unlocked __udp_disconnect

PATCH In review Cyrill Gorcunov 3 participants 4 messages Nov 1, 2016 – Nov 2, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ip, diag -- Adjust raw_abort to use unlocked __udp_disconnect

While being preparing patches for killing raw sockets via diag netlink interface I noticed that my runs are stuck:

 | [root@pcs7 ~]# cat /proc/`pidof ss`/stack
 | [<ffffffff816d1a76>] __lock_sock+0x80/0xc4
 | [<ffffffff816d206a>] lock_sock_nested+0x47/0x95
 | [<ffffffff8179ded6>] udp_disconnect+0x19/0x33
 | [<ffffffff8179b517>] raw_abort+0x33/0x42
 | [<ffffffff81702322>] sock_diag_destroy+0x4d/0x52

which has not been the case before. I narrowed it down to the commit

 | commit 286c72deabaa240b7eebbd99496ed3324d69f3c0
 | Author: Eric Dumazet <[email protected]>
 | Date:   Thu Oct 20 09:39:40 2016 -0700
 | 
 |     udp: must lock the socket in udp_disconnect()

where we start locking the socket for different reason.

So the raw_abort escaped the renaming and we have to fix this typo using __udp_disconnect instead.

CC David S. Miller <[email protected]>
CC Eric Dumazet <[email protected]>
CC David Ahern <[email protected]>
CC Alexey Kuznetsov <[email protected]>
CC James Morris <[email protected]>
CC Hideaki YOSHIFUJI <[email protected]>
CC Patrick McHardy <[email protected]>
CC Andrey Vagin <[email protected]>
CC Stephen Hemminger <[email protected]>

---

On top of net-next tree 22ca904ad70afc831d8503e80be1b6558a978759

 net/ipv4/raw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/raw.c +1 -1
Index: linux-ml.git/net/ipv4/raw.c
===================================================================
@@ -920,7 +920,7 @@ int raw_abort(struct sock *sk, int err)
 
 	sk->sk_err = err;
 	sk->sk_error_report(sk);
-	udp_disconnect(sk, 0);
+	__udp_disconnect(sk, 0);
 
 	release_sock(sk);
 
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Cyrill Gorcunov

While being preparing patches for killing raw sockets via diag netlink interface I noticed that my runs are stuck:

 | [root@pcs7 ~]# cat /proc/`pidof ss`/stack
 | [<ffffffff816d1a76>] __lock_sock+0x80/0xc4
 | [<ffffffff816d206a>] lock_sock_nested+0x47/0x95
 | [<ffffffff8179ded6>] udp_disconnect+0x19/0x33
 | [<ffffffff8179b517>] raw_abort+0x33/0x42
 | [<ffffffff81702322>] sock_diag_destroy+0x4d/0x52

which has not been the case before. I narrowed it down to the commit

 | commit 286c72deabaa240b7eebbd99496ed3324d69f3c0
 | Author: Eric Dumazet <[email protected]>
 | Date:   Thu Oct 20 09:39:40 2016 -0700
 | 
 |     udp: must lock the socket in udp_disconnect()
Quoted 5 lines

where we start locking the socket for different reason.

So the raw_abort escaped the renaming and we have to fix this typo using __udp_disconnect instead.

The preferred way to cite a bug origin is :

Fixes 286c72deabaa ("udp: must lock the socket in udp_disconnect()")
Quoted 9 lines
CC David S. Miller <[email protected]>
CC Eric Dumazet <[email protected]>
CC David Ahern <[email protected]>
CC Alexey Kuznetsov <[email protected]>
CC James Morris <[email protected]>
CC Hideaki YOSHIFUJI <[email protected]>
CC Patrick McHardy <[email protected]>
CC Andrey Vagin <[email protected]>
CC Stephen Hemminger <[email protected]>

That is a lot of CC ...

Quoted 1 line

Thanks.

#2 lore raw
Quoted 4 lines · Eric Dumazet

The preferred way to cite a bug origin is :

Fixes 286c72deabaa ("udp: must lock the socket in udp_disconnect()")

Aha. Thank you, will do this way next time.

Quoted 11 lines
Quoted 9 lines
CC David S. Miller <[email protected]>
CC Eric Dumazet <[email protected]>
CC David Ahern <[email protected]>
CC Alexey Kuznetsov <[email protected]>
CC James Morris <[email protected]>
CC Hideaki YOSHIFUJI <[email protected]>
CC Patrick McHardy <[email protected]>
CC Andrey Vagin <[email protected]>
CC Stephen Hemminger <[email protected]>

That is a lot of CC ...

Because I CC'ed all for raw diag first patch, so I thought I've to notify them with this typo in code.

Quoted 7 lines
Quoted 1 line

Thanks.

Cyrill

maintainer
#3 lore raw
In reply to Cyrill Gorcunov

From: Cyrill Gorcunov <[email protected]>
Date: Tue, 1 Nov 2016 23:05:00 +0300

Quoted 23 lines

While being preparing patches for killing raw sockets via diag netlink interface I noticed that my runs are stuck:

 | [root@pcs7 ~]# cat /proc/`pidof ss`/stack
 | [<ffffffff816d1a76>] __lock_sock+0x80/0xc4
 | [<ffffffff816d206a>] lock_sock_nested+0x47/0x95
 | [<ffffffff8179ded6>] udp_disconnect+0x19/0x33
 | [<ffffffff8179b517>] raw_abort+0x33/0x42
 | [<ffffffff81702322>] sock_diag_destroy+0x4d/0x52

which has not been the case before. I narrowed it down to the commit

 | commit 286c72deabaa240b7eebbd99496ed3324d69f3c0
 | Author: Eric Dumazet <[email protected]>
 | Date:   Thu Oct 20 09:39:40 2016 -0700
 | 
 |     udp: must lock the socket in udp_disconnect()

where we start locking the socket for different reason.

So the raw_abort escaped the renaming and we have to fix this typo using __udp_disconnect instead.

Quoted 10 lines
CC David S. Miller <[email protected]>
CC Eric Dumazet <[email protected]>
CC David Ahern <[email protected]>
CC Alexey Kuznetsov <[email protected]>
CC James Morris <[email protected]>
CC Hideaki YOSHIFUJI <[email protected]>
CC Patrick McHardy <[email protected]>
CC Andrey Vagin <[email protected]>
CC Stephen Hemminger <[email protected]>

Applied with proper Fixes: tag added.