Skip to content

Commit 1a63cb9

Browse files
q2vendavem330
authored andcommitted
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: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4845b57 commit 1a63cb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_output.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3105,7 +3105,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to,
31053105
struct sk_buff *skb = to, *tmp;
31063106
bool first = true;
31073107

3108-
if (!sock_net(sk)->ipv4.sysctl_tcp_retrans_collapse)
3108+
if (!READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_retrans_collapse))
31093109
return;
31103110
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_SYN)
31113111
return;

0 commit comments

Comments
 (0)