]> git.baikalelectronics.ru Git - kernel.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:24:28 +0000 (21:24 +0200)
commitf237f34f759eb7f16ab89b858483ca85e30dc2b7
treecd9b6827ee62dbf0c53ea5d85e656d829461bd2b
parentac746f6dfe37ff67d95f563b07fa5d6110bfd9cb
nexthop: Fix data-races around nexthop_compat_mode.

[ Upstream commit bf5791759f846c475ef1f4b761f56b1e4716df47 ]

While reading nexthop_compat_mode, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.

Fixes: c42c4d1c4809 ("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