diff options
author | Eric Dumazet <edumazet@google.com> | 2018-10-02 12:35:05 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-10-18 09:18:10 +0200 |
commit | efef3f2073d166b7403380106eeeb2209cb65220 (patch) | |
tree | f39c50db5a20015c4f96d6e0271fc8725fc213b7 /include/net | |
parent | 9fd4b0122ac320382d0d259e47a80009cf71751d (diff) | |
download | linux-stable-efef3f2073d166b7403380106eeeb2209cb65220.tar.gz linux-stable-efef3f2073d166b7403380106eeeb2209cb65220.tar.bz2 linux-stable-efef3f2073d166b7403380106eeeb2209cb65220.zip |
inet: make sure to grab rcu_read_lock before using ireq->ireq_opt
[ Upstream commit 2ab2ddd301a22ca3c5f0b743593e4ad2953dfa53 ]
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: 1ad98e9d1bdf ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/inet_sock.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 6310fd4e1220..7dba2d116e8c 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h @@ -130,11 +130,6 @@ static inline int inet_request_bound_dev_if(const struct sock *sk, return sk->sk_bound_dev_if; } -static inline struct ip_options_rcu *ireq_opt_deref(const struct inet_request_sock *ireq) -{ - return rcu_dereference(ireq->ireq_opt); -} - struct inet_cork { unsigned int flags; __be32 addr; |