diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-24 15:58:54 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-24 21:16:29 -0400 |
commit | ff74e23f7edb3759d1290b10f80222e3bbb6304b (patch) | |
tree | 72cb9b6121234d31fc179bf9d780c51f3c3a6e85 /net/ipv4/tcp_ipv4.c | |
parent | 0980c1e3084572b1d6c35ace5d795cf68b7ae409 (diff) | |
download | op-kernel-dev-ff74e23f7edb3759d1290b10f80222e3bbb6304b.zip op-kernel-dev-ff74e23f7edb3759d1290b10f80222e3bbb6304b.tar.gz |
tcp: md5: input path is run under rcu protected sections
It is guaranteed that both tcp_v4_rcv() and tcp_v6_rcv()
run from rcu read locked sections :
ip_local_deliver_finish() and ip6_input_finish() both
use rcu_read_lock()
Also align tcp_v6_inbound_md5_hash() on tcp_v4_inbound_md5_hash()
by returning a boolean.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 4e90217..d339a04 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1153,8 +1153,9 @@ clear_hash_noput: } EXPORT_SYMBOL(tcp_v4_md5_hash_skb); -static bool __tcp_v4_inbound_md5_hash(struct sock *sk, - const struct sk_buff *skb) +/* Called with rcu_read_lock() */ +static bool tcp_v4_inbound_md5_hash(struct sock *sk, + const struct sk_buff *skb) { /* * This gets called for each TCP segment that arrives @@ -1206,18 +1207,6 @@ static bool __tcp_v4_inbound_md5_hash(struct sock *sk, } return false; } - -static bool tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb) -{ - bool ret; - - rcu_read_lock(); - ret = __tcp_v4_inbound_md5_hash(sk, skb); - rcu_read_unlock(); - - return ret; -} - #endif static void tcp_v4_init_req(struct request_sock *req, struct sock *sk_listener, |