diff options
author | Eric Dumazet <edumazet@google.com> | 2023-07-28 17:03:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-07-29 19:13:41 +0200 |
commit | 3c5b4d69c358a9275a8de98f87caf6eda644b086 (patch) | |
tree | fa45713da2bb8c9dc9c4728dcdb990ebd86c98d5 /net/xfrm | |
parent | net: add missing READ_ONCE(sk->sk_rcvbuf) annotation (diff) | |
download | linux-3c5b4d69c358a9275a8de98f87caf6eda644b086.tar.xz linux-3c5b4d69c358a9275a8de98f87caf6eda644b086.zip |
net: annotate data-races around sk->sk_mark
sk->sk_mark is often read while another thread could change the value.
Fixes: 4a19ec5800fc ("[NET]: Introducing socket mark socket option.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index e7617c9959c3..d6b405782b63 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2250,7 +2250,7 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir, match = xfrm_selector_match(&pol->selector, fl, family); if (match) { - if ((sk->sk_mark & pol->mark.m) != pol->mark.v || + if ((READ_ONCE(sk->sk_mark) & pol->mark.m) != pol->mark.v || pol->if_id != if_id) { pol = NULL; goto out; |