From: Cong Wang <xiyou.wangc...@gmail.com> Date: Tue, 3 Nov 2015 15:41:16 -0800
> Sasha reported the following lockdep warning: > > Possible unsafe locking scenario: > > CPU0 CPU1 > ---- ---- > lock(sk_lock-AF_INET); > lock(rtnl_mutex); > lock(sk_lock-AF_INET); > lock(rtnl_mutex); > > This is due to that for IP_MSFILTER and MCAST_MSFILTER, we take > rtnl lock before the socket lock in setsockopt() path, but take > the socket lock before rtnl lock in getsockopt() path. All the > rest optnames are setsockopt()-only. > > Fix this by aligning the getsockopt() path with the setsockopt() > path, so that all mcast socket path would be locked in the same > order. > > Note, IPv6 part is different where rtnl lock is not held. > > Fixes: 54ff9ef36bdf ("ipv4, ipv6: kill ip_mc_{join, leave}_group and > ipv6_sock_mc_{join, drop}") > Reported-by: Sasha Levin <sasha.le...@oracle.com> > Cc: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> > Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> I don't like conditional locking, but I can't think of a better way to suggest fixing this, so applied. And queued up for -stable as well. Thanks! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html