summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-02-28 13:54:30 +0000
committerDavid S. Miller <davem@davemloft.net>2024-03-01 08:42:31 +0000
commit32f754176e889cdfe989ef08ece19859427755df (patch)
treeaf0f0215d2574da45535a83add3e4336d5c16d59 /net/core
parente0bb2675fea2783c45bb95d74f00c55156720863 (diff)
downloadlinux-stable-32f754176e889cdfe989ef08ece19859427755df.tar.gz
linux-stable-32f754176e889cdfe989ef08ece19859427755df.tar.bz2
linux-stable-32f754176e889cdfe989ef08ece19859427755df.zip
ipv6: annotate data-races around cnf.forwarding
idev->cnf.forwarding and net->ipv6.devconf_all->forwarding might be read locklessly, add appropriate READ_ONCE() and WRITE_ONCE() annotations. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 358870408a51..58e8e1a70aa7 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -5988,7 +5988,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
return -ENODEV;
idev = __in6_dev_get_safely(dev);
- if (unlikely(!idev || !idev->cnf.forwarding))
+ if (unlikely(!idev || !READ_ONCE(idev->cnf.forwarding)))
return BPF_FIB_LKUP_RET_FWD_DISABLED;
if (flags & BPF_FIB_LOOKUP_OUTPUT) {