diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-18 10:26:39 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-29 17:28:11 +0200 |
commit | 14e996577ed2799a1ed6ffeb71c76d63acb28444 (patch) | |
tree | dcf7092f2934b89134abfe25bc8d32871f76c126 /net/ipv4/fib_semantics.c | |
parent | 789085deb33dc1d4cb1763ac7af351da9287a99b (diff) | |
download | linux-stable-14e996577ed2799a1ed6ffeb71c76d63acb28444.tar.gz |
ipv4: Fix a data-race around sysctl_fib_multipath_use_neigh.
[ Upstream commit 87507bcb4f5de16bb419e9509d874f4db6c0ad0f ]
While reading sysctl_fib_multipath_use_neigh, it can be changed
concurrently. Thus, we need to add READ_ONCE() to its reader.
Fixes: a6db4494d218 ("net: ipv4: Consider failed nexthops in multipath routes")
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 720f65f7bd0b..9f5c1c26c8f2 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -2216,7 +2216,7 @@ void fib_select_multipath(struct fib_result *res, int hash) } change_nexthops(fi) { - if (net->ipv4.sysctl_fib_multipath_use_neigh) { + if (READ_ONCE(net->ipv4.sysctl_fib_multipath_use_neigh)) { if (!fib_good_nh(nexthop_nh)) continue; if (!first) { |