tcp: md5: fix rcu lockdep splat
authorEric Dumazet <edumazet@google.com>
Tue, 24 Mar 2015 22:58:52 +0000 (15:58 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Mar 2015 01:16:29 +0000 (21:16 -0400)
commit80f03e27a309f3e32ebdd9629ac0320005a2180b
tree4516faa5da144dde9c1cd899ae3d99090e3852db
parent9ead3527f5967440f2ff57fd2fa25dd0e460fc5a
tcp: md5: fix rcu lockdep splat

While timer handler effectively runs a rcu read locked section,
there is no explicit rcu_read_lock()/rcu_read_unlock() annotations
and lockdep can be confused here :

net/ipv4/tcp_ipv4.c-906-        /* caller either holds rcu_read_lock() or socket lock */
net/ipv4/tcp_ipv4.c:907:        md5sig = rcu_dereference_check(tp->md5sig_info,
net/ipv4/tcp_ipv4.c-908-                                       sock_owned_by_user(sk) ||
net/ipv4/tcp_ipv4.c-909-                                       lockdep_is_held(&sk->sk_lock.slock));

Let's explicitely acquire rcu_read_lock() in tcp_make_synack()

Before commit fa76ce7328b ("inet: get rid of central tcp/dccp listener
timer"), we were holding listener lock so lockdep was happy.

Fixes: fa76ce7328b ("inet: get rid of central tcp/dccp listener timer")
Signed-off-by: Eric DUmazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c