]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Fix a data-race around sysctl_tcp_ecn_fallback.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 12 Jul 2022 00:15:31 +0000 (17:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:27 +0000 (21:24 +0200)
commitb1aa80e18b4d277e3dfcc01f955082e3f8a9a713
tree186b1c642bc8b7b57f9f7c9cca38f6b106ce099e
parent922158d891243830f6f36169509cb0cb9392c7e2
tcp: Fix a data-race around sysctl_tcp_ecn_fallback.

[ Upstream commit 848463747f32b848b109713de5df71372dfa1902 ]

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

Fixes: d444f4d90464 ("tcp: add rfc3168, section 6.1.1.1. fallback")
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/sysctl_net_ipv4.c
net/ipv4/tcp_output.c