]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Fix a data-race around sysctl_tcp_max_orphans.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 6 Jul 2022 23:39:58 +0000 (16:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:21 +0000 (21:24 +0200)
commitc5ef103b6ef618da59e60697230d1a7be5180ebe
tree647322ce8f3523ded1616afa103fdea9fb5c46ad
parent1780009b80906bb21247e8032c2b94588dc5d483
tcp: Fix a data-race around sysctl_tcp_max_orphans.

[ Upstream commit be0127d383b30c105e320dbdfa551209ef7c7010 ]

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

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/tcp.c