]> git.baikalelectronics.ru Git - kernel.git/commit
inetpeer: Fix data-races around sysctl.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 6 Jul 2022 23:39:59 +0000 (16:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 18:59:20 +0000 (20:59 +0200)
commit00c86679f55d3a1b5dbd0457f9b961cb69117bd3
tree25d83acbea929de30a252cd48810ee1354aec6a6
parent459e7b3a133cc72fed6415dd3aca8d49f0916c1e
inetpeer: Fix data-races around sysctl.

[ Upstream commit 6b57871d3c973646a4e481abc6300dad796da9e5 ]

While reading inetpeer sysctl variables, they 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>
net/ipv4/inetpeer.c