| Submitter | Eric Dumazet |
|---|---|
| Date | March 7, 2012, 2:45 p.m. |
| Message ID | <1331131543.2474.72.camel@edumazet-laptop> |
| Download | mbox | patch |
| Permalink | /patch/145302/ |
| State | Accepted |
| Delegated to: | David Miller |
| Headers | show |
Comments
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Wed, 07 Mar 2012 06:45:43 -0800 > [PATCH net-next] tcp: md5: correct a RCU lockdep splat > > commit a8afca0329 (tcp: md5: protects md5sig_info with RCU) added a > lockdep splat in tcp_md5_do_lookup() in case a timer fires a tcp > retransmit. > > At this point, socket lock is owned by the sofirq handler, not the user, > so we should adjust a bit the lockdep condition, as we dont hold > rcu_read_lock(). > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> > Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu> Applied, thanks Eric. -- 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
Patch
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 94abee8..507924b 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -927,7 +927,8 @@ struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, /* caller either holds rcu_read_lock() or socket lock */ md5sig = rcu_dereference_check(tp->md5sig_info, - sock_owned_by_user(sk)); + sock_owned_by_user(sk) || + lockdep_is_held(&sk->sk_lock.slock)); if (!md5sig) return NULL; #if IS_ENABLED(CONFIG_IPV6)