diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-12 02:15:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-13 13:56:50 +0200 |
commit | bdf00bf24bef9be1ca641a6390fd5487873e0d2e (patch) | |
tree | a571db15de0e5ac08997aab9705356eff39685b6 /net/ipv4/fib_semantics.c | |
parent | ipv4: Fix data-races around sysctl_ip_dynaddr. (diff) | |
download | linux-bdf00bf24bef9be1ca641a6390fd5487873e0d2e.tar.xz linux-bdf00bf24bef9be1ca641a6390fd5487873e0d2e.zip |
nexthop: Fix data-races around nexthop_compat_mode.
While reading nexthop_compat_mode, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.
Fixes: 4f80116d3df3 ("net: ipv4: add sysctl for nexthop api compatibility mode")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r-- | net/ipv4/fib_semantics.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index a57ba23571c9..16dbd5075284 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -1811,7 +1811,7 @@ int fib_dump_info(struct sk_buff *skb, u32 portid, u32 seq, int event, goto nla_put_failure; if (nexthop_is_blackhole(fi->nh)) rtm->rtm_type = RTN_BLACKHOLE; - if (!fi->fib_net->ipv4.sysctl_nexthop_compat_mode) + if (!READ_ONCE(fi->fib_net->ipv4.sysctl_nexthop_compat_mode)) goto offload; } |