Message ID | 1447879213.22599.182.camel@edumazet-glaptop2.roam.corp.google.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Wed, 18 Nov 2015 12:40:13 -0800 > From: Eric Dumazet <edumazet@google.com> > > When a passive TCP is created, we eventually call tcp_md5_do_add() > with sk pointing to the child. It is not owner by the user yet (we > will add this socket into listener accept queue a bit later anyway) > > But we do own the spinlock, so amend the lockdep annotation to avoid > following splat : ... > Fixes: a8afca0329988 ("tcp: md5: protects md5sig_info with RCU") > Signed-off-by: Eric Dumazet <edumazet@google.com> > Reported-by: Willem de Bruijn <willemb@google.com> Applied and queued up for -stable, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index ba09016d1bfd..db003438aaf5 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -921,7 +921,8 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, } md5sig = rcu_dereference_protected(tp->md5sig_info, - sock_owned_by_user(sk)); + sock_owned_by_user(sk) || + lockdep_is_held(&sk->sk_lock.slock)); if (!md5sig) { md5sig = kmalloc(sizeof(*md5sig), gfp); if (!md5sig)