]> git.baikalelectronics.ru Git - kernel.git/commit
net: Fix data-races around sysctl_mem.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 6 Jul 2022 23:40:00 +0000 (16:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:21 +0000 (21:24 +0200)
commit6f81e5bfdbb3c44d901d5d0f038714e73e822aee
tree2d02fde55954a678b1d5b36af660798c1e0f83cf
parent4ada8b0f77835f174c43c58f0399a28fdaf0c2e8
net: Fix data-races around sysctl_mem.

[ Upstream commit 6ccc8b7ee6025545ad0a14ab97e4bada5e479c71 ]

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

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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>
include/net/sock.h