diff options
| author | Kuniyuki Iwashima <[email protected]> | 2022-07-18 17:26:49 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-07-20 09:14:50 +0000 |
| commit | 1a63cb91f0c2fcdeced6d6edee8d1d886583d139 (patch) | |
| tree | e9390950f5838cd0976703342a3b47792fa80e04 /net/ipv4/tcp_output.c | |
| parent | tcp: Fix data-races around sysctl_tcp_slow_start_after_idle. (diff) | |
| download | kernel-1a63cb91f0c2fcdeced6d6edee8d1d886583d139.tar.gz kernel-1a63cb91f0c2fcdeced6d6edee8d1d886583d139.zip | |
tcp: Fix a data-race around sysctl_tcp_retrans_collapse.
While reading sysctl_tcp_retrans_collapse, 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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -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 51120407c570..c38e07b50639 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3105,7 +3105,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to, struct sk_buff *skb = to, *tmp; bool first = true; - if (!sock_net(sk)->ipv4.sysctl_tcp_retrans_collapse) + if (!READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_retrans_collapse)) return; if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN) return; |
