Skip to content

Commit 706c620

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_frto.
While reading sysctl_tcp_frto, 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 36eeee7 commit 706c620

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,7 @@ void tcp_enter_loss(struct sock *sk)
21752175
* loss recovery is underway except recurring timeout(s) on
21762176
* the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing
21772177
*/
2178-
tp->frto = net->ipv4.sysctl_tcp_frto &&
2178+
tp->frto = READ_ONCE(net->ipv4.sysctl_tcp_frto) &&
21792179
(new_recovery || icsk->icsk_retransmits) &&
21802180
!inet_csk(sk)->icsk_mtup.probe_size;
21812181
}

0 commit comments

Comments
 (0)