ipv4: Fix data-races around sysctl_fib_multipath_hash_fields.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Mon, 18 Jul 2022 17:26:41 +0000 (10:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:21 +0000 (17:25 +0200)
commit36f5b86f309b3b11295d087cd7433f1c897caf94
tree6b4d61d95065e78216f1e57cfdceddb5cc5a8614
parent21fb844bc1dc1461f5038d655aa1a14f39e13049
ipv4: Fix data-races around sysctl_fib_multipath_hash_fields.

[ Upstream commit 8895a9c2ac76fb9d3922fed4fe092c8ec5e5cccc ]

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

Fixes: ce5c9c20d364 ("ipv4: Add a sysctl to control multipath hash fields")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.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/route.c