]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Fix a data-race around sysctl_fib_sync_mem.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 6 Jul 2022 23:40:03 +0000 (16:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:22 +0000 (21:24 +0200)
commit8b8c1c57c2e0b3b405322ff80e6a7e67e5cf2a48
tree5c2c4e6d32b0b9048e416a5da0c8af8825992163
parent549984a679bde3d755bce5a46ec69bea9c6260fd
ipv4: Fix a data-race around sysctl_fib_sync_mem.

[ Upstream commit bc745d73905da4acb846418d9a35a6d032ed9aac ]

While reading sysctl_fib_sync_mem, it can be changed concurrently.
So, we need to add READ_ONCE() to avoid a data-race.

Fixes: a4600cdec625 ("ipv4: Allow amount of dirty memory from fib resizing to be controllable")
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_trie.c