Files
linux/net/ipv6
WANG Cong faf4586056 ipv6: fix a potential deadlock in do_ipv6_setsockopt()
commit 8651be8f14 upstream.

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 87e9f03159
("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: baf606d9c9 ("ipv4,ipv6: grab rtnl before locking the socket")
Reported-by: Baozeng Ding <sploving1@gmail.com>
Tested-by: Baozeng Ding <sploving1@gmail.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-16 19:45:05 +02:00
..
2019-02-23 09:05:13 +01:00
2015-10-08 04:27:03 -07:00
2015-12-03 11:32:06 -05:00
2017-09-27 11:00:12 +02:00
2015-09-17 17:18:37 -07:00
2017-06-14 13:16:19 +02:00
2017-06-14 13:16:19 +02:00
2015-02-28 16:56:51 -05:00
2015-11-03 10:52:13 -05:00
2019-03-23 08:44:29 +01:00