summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-07-18 19:26:39 +0200
committerDavid S. Miller <davem@davemloft.net>2022-07-20 11:14:49 +0200
commit87507bcb4f5de16bb419e9509d874f4db6c0ad0f (patch)
treeba1da190ab8cfb9dde5bcdc80d4b0eaea50b4ad5 /net/ipv4/fib_semantics.c
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klasse... (diff)
downloadlinux-87507bcb4f5de16bb419e9509d874f4db6c0ad0f.tar.xz
linux-87507bcb4f5de16bb419e9509d874f4db6c0ad0f.zip
ipv4: Fix a data-race around sysctl_fib_multipath_use_neigh.
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>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index d9fdcbae16ee..db7b2503f068 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) {