Skip to content

Commit 52e6586

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_early_retrans.
While reading sysctl_tcp_early_retrans, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: eed530b ("tcp: early retransmit") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3666f66 commit 52e6586

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
@@ -2741,7 +2741,7 @@ bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto)
27412741
if (rcu_access_pointer(tp->fastopen_rsk))
27422742
return false;
27432743

2744-
early_retrans = sock_net(sk)->ipv4.sysctl_tcp_early_retrans;
2744+
early_retrans = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_early_retrans);
27452745
/* Schedule a loss probe in 2*RTT for SACK capable connections
27462746
* not in loss recovery, that are either limited by cwnd or application.
27472747
*/

0 commit comments

Comments
 (0)