diff options
author | WANG Cong <[email protected]> | 2016-10-19 23:35:12 -0700 |
---|---|---|
committer | David S. Miller <[email protected]> | 2016-10-21 11:29:02 -0400 |
commit | 8651be8f14a12d24f203f283601d9b0418c389ff (patch) | |
tree | 15f086903cd41889f29e23ac2f80d8bb77f7ead4 /net/unix/sysctl_net_unix.c | |
parent | 8dbad1a81128f7e224fce3cce28a1d545d9c0b88 (diff) |
ipv6: fix a potential deadlock in do_ipv6_setsockopt()
Baozeng reported this deadlock case:
CPU0 CPU1
---- ----
lock([ 165.136033] sk_lock-AF_INET6);
lock([ 165.136033] rtnl_mutex);
lock([ 165.136033] sk_lock-AF_INET6);
lock([ 165.136033] rtnl_mutex);
Similar to commit 87e9f0315952
("ipv4: fix a potential deadlock in mcast getsockopt() path")
this is due to we still have a case, ipv6_sock_mc_close(),
where we acquire sk_lock before rtnl_lock. Close this deadlock
with the similar solution, that is always acquire rtnl lock first.
Fixes: baf606d9c9b1 ("ipv4,ipv6: grab rtnl before locking the socket")
Reported-by: Baozeng Ding <[email protected]>
Tested-by: Baozeng Ding <[email protected]>
Cc: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Reviewed-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions