diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-11 17:15:33 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-22 10:21:40 +0200 |
commit | ae3054f6fbccc90f14ecd6cf9b2c09a2401c64fd (patch) | |
tree | df2f85085f49f074bbd34eb5ffa1135ce7c3b16d /net/ipv4/fib_semantics.c | |
parent | f5042c5357ce931f1666faf6b26b27d12cbcc633 (diff) | |
download | linux-stable-ae3054f6fbccc90f14ecd6cf9b2c09a2401c64fd.tar.gz |
nexthop: Fix data-races around nexthop_compat_mode.
[ Upstream commit bdf00bf24bef9be1ca641a6390fd5487873e0d2e ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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 1c4fef385ef6..720f65f7bd0b 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; } |