ip: Fix data-races around sysctl_ip_fwd_update_priority.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 13 Jul 2022 20:51:54 +0000 (13:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:13 +0000 (17:25 +0200)
commit351f81f7d7185d18a9ff76f8f8c2fa8c4eea563b
treeeae126a3ebb8b4505a1aa15bd94b71d8647c3a54
parent93fbc06da1d819f3981a7bd7928c3641ea67b364
ip: Fix data-races around sysctl_ip_fwd_update_priority.

[ Upstream commit 7bf9e18d9a5e99e3c83482973557e9f047b051e7 ]

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

Fixes: 432e05d32892 ("net: ipv4: Control SKB reprioritization after forwarding")
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>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
net/ipv4/ip_forward.c