summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-07-18 10:26:48 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-07-29 17:14:15 +0200
commit369d99c2b89f54473adcf9acdf40ea562b5a6e0e (patch)
tree59ff24a4994728faa14b4302ef700461764ad710 /include
parent492f3713b282c0e67e951cd804edd22eccc25412 (diff)
downloadlinux-stable-369d99c2b89f54473adcf9acdf40ea562b5a6e0e.tar.gz
linux-stable-369d99c2b89f54473adcf9acdf40ea562b5a6e0e.tar.bz2
linux-stable-369d99c2b89f54473adcf9acdf40ea562b5a6e0e.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 'include')
-rw-r--r--include/net/tcp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index eb984ec22f22..aaf1d5d5a13b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1373,8 +1373,8 @@ static inline void tcp_slow_start_after_idle_check(struct sock *sk)
struct tcp_sock *tp = tcp_sk(sk);
s32 delta;
- if (!sock_net(sk)->ipv4.sysctl_tcp_slow_start_after_idle || tp->packets_out ||
- ca_ops->cong_control)
+ if (!READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_slow_start_after_idle) ||
+ tp->packets_out || ca_ops->cong_control)
return;
delta = tcp_jiffies32 - tp->lsndtime;
if (delta > inet_csk(sk)->icsk_rto)