diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-18 10:26:48 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-29 17:25:22 +0200 |
commit | 41aeba4506f6b70ec7500c6fe202731a4ba29fe5 (patch) | |
tree | d74b40c2dc4ae7b2153b4cd82d19b38b571ee89e /net/ipv4 | |
parent | 404c53ccdebd11f96954f4070cffac8e0b4d5cb6 (diff) | |
download | linux-stable-41aeba4506f6b70ec7500c6fe202731a4ba29fe5.tar.gz linux-stable-41aeba4506f6b70ec7500c6fe202731a4ba29fe5.tar.bz2 linux-stable-41aeba4506f6b70ec7500c6fe202731a4ba29fe5.zip |
tcp: Fix data-races around sysctl_tcp_slow_start_after_idle.
[ Upstream commit 4845b5713ab18a1bb6e31d1fbb4d600240b8b691 ]
While reading sysctl_tcp_slow_start_after_idle, it can be changed
concurrently. Thus, we need to add READ_ONCE() to its readers.
Fixes: 35089bb203f4 ("[TCP]: Add tcp_slow_start_after_idle sysctl.")
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 3b71d8735995..94f7841f7bfb 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1901,7 +1901,7 @@ static void tcp_cwnd_validate(struct sock *sk, bool is_cwnd_limited) if (tp->packets_out > tp->snd_cwnd_used) tp->snd_cwnd_used = tp->packets_out; - if (sock_net(sk)->ipv4.sysctl_tcp_slow_start_after_idle && + if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_slow_start_after_idle) && (s32)(tcp_jiffies32 - tp->snd_cwnd_stamp) >= inet_csk(sk)->icsk_rto && !ca_ops->cong_control) tcp_cwnd_application_limited(sk); |