diff options
author | Eric Dumazet <edumazet@google.com> | 2015-12-08 18:22:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-12 03:22:06 +0300 |
commit | d188ba86dd07a72ebebfa22fe9cb0b0572e57740 (patch) | |
tree | 3633c759d096b6fccc50e5641b1dcf8633a1dbf5 /net/core | |
parent | 56f047305dd4b6b61771ac4f523718e4111052a8 (diff) | |
download | linux-d188ba86dd07a72ebebfa22fe9cb0b0572e57740.tar.xz |
xfrm: add rcu protection to sk->sk_policy[]
XFRM can deal with SYNACK messages, sent while listener socket
is not locked. We add proper rcu protection to __xfrm_sk_clone_policy()
and xfrm_sk_policy_lookup()
This might serve as the first step to remove xfrm.xfrm_policy_lock
use in fast path.
Fixes: fa76ce7328b2 ("inet: get rid of central tcp/dccp listener timer")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index d01c8f42dbb2..765be835b06c 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1550,7 +1550,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) */ is_charged = sk_filter_charge(newsk, filter); - if (unlikely(!is_charged || xfrm_sk_clone_policy(newsk))) { + if (unlikely(!is_charged || xfrm_sk_clone_policy(newsk, sk))) { /* It is still raw copy of parent, so invalidate * destructor and make plain sk_free() */ newsk->sk_destruct = NULL; |