]> www.infradead.org Git - users/dwmw2/linux.git/commit
nexthop: Fix data-races around nexthop_compat_mode.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 12 Jul 2022 00:15:33 +0000 (17:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:20:10 +0000 (21:20 +0200)
commita51040d4b120f3520df64fb0b9c63b31d69bea9b
tree92bb629fb06f462bcf654e40ebf049fe83e5f7ea
parent2c56958de89b9a2efdb19310e3f11a6b97254d39
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>
net/ipv4/fib_semantics.c
net/ipv4/nexthop.c
net/ipv6/route.c