]> git.baikalelectronics.ru Git - kernel.git/commit
inet: make sure to grab rcu_read_lock before using ireq->ireq_opt
authorEric Dumazet <edumazet@google.com>
Tue, 2 Oct 2018 19:35:05 +0000 (12:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Oct 2018 22:52:12 +0000 (15:52 -0700)
commit46bfd82412c9f9df07f3350968f8b03a4b6500ac
tree3ec72a50a6be78a4bc8eb73d8c9bd14df798aa26
parent24fbbd7644fb57160d41374319e36ce0f031cd80
inet: make sure to grab rcu_read_lock before using ireq->ireq_opt

Timer handlers do not imply rcu_read_lock(), so my recent fix
triggered a LOCKDEP warning when SYNACK is retransmit.

Lets add rcu_read_lock()/rcu_read_unlock() pairs around ireq->ireq_opt
usages instead of guessing what is done by callers, since it is
not worth the pain.

Get rid of ireq_opt_deref() helper since it hides the logic
without real benefit, since it is now a standard rcu_dereference().

Fixes: 31ab0e81adf5 ("tcp/dccp: fix lockdep issue when SYN is backlogged")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_sock.h
net/dccp/ipv4.c
net/ipv4/inet_connection_sock.c
net/ipv4/tcp_ipv4.c