]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Fix a data-race around sysctl_tcp_tw_reuse.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 15 Jul 2022 17:17:52 +0000 (10:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:14:13 +0000 (17:14 +0200)
commitd72d617d9d7db87581dc2af4bcb741b4a2540299
tree1328b353da5cd4d4cf189981cde078e8d0c58b0d
parent4fd14997a794af53ccfad0da719cf12e63077118
tcp: Fix a data-race around sysctl_tcp_tw_reuse.

[ Upstream commit 8c790725c3e8be79042d2ff1be8135048e90cf43 ]

While reading sysctl_tcp_tw_reuse, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.

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_ipv4.c