]> 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)
commit63394e39506d8213b3a7f183c0a509989c4a589f
tree25d83acbea929de30a252cd48810ee1354aec6a6
parent1f7bbbf8c2a43b91b7311b59c0d0166772415b40
inetpeer: Fix data-races around sysctl.

[ Upstream commit 39caff4e6473d296c970d2a0bb239d20188900df ]

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