Skip to content

Commit 7c6f2a8

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts.
While reading sysctl_tcp_thin_linear_timeouts, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 36e31b0 ("net: TCP thin linear timeouts") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e7d2ef8 commit 7c6f2a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ void tcp_retransmit_timer(struct sock *sk)
578578
* linear-timeout retransmissions into a black hole
579579
*/
580580
if (sk->sk_state == TCP_ESTABLISHED &&
581-
(tp->thin_lto || net->ipv4.sysctl_tcp_thin_linear_timeouts) &&
581+
(tp->thin_lto || READ_ONCE(net->ipv4.sysctl_tcp_thin_linear_timeouts)) &&
582582
tcp_stream_is_thin(tp) &&
583583
icsk->icsk_retransmits <= TCP_THIN_LINEAR_RETRIES) {
584584
icsk->icsk_backoff = 0;

0 commit comments

Comments
 (0)