Skip to content

Commit 2455e61

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_tso_rtt_log.
While reading sysctl_tcp_tso_rtt_log, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 6546690 ("tcp: adjust TSO packet sizes based on min_rtt") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0bb4ab commit 2455e61

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
@@ -1976,7 +1976,7 @@ static u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
19761976

19771977
bytes = sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift);
19781978

1979-
r = tcp_min_rtt(tcp_sk(sk)) >> sock_net(sk)->ipv4.sysctl_tcp_tso_rtt_log;
1979+
r = tcp_min_rtt(tcp_sk(sk)) >> READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_tso_rtt_log);
19801980
if (r < BITS_PER_TYPE(sk->sk_gso_max_size))
19811981
bytes += sk->sk_gso_max_size >> r;
19821982

0 commit comments

Comments
 (0)