Skip to content

Commit 9fb9019

Browse files
q2vendavem330
authored andcommitted
tcp: Fix a data-race around sysctl_tcp_limit_output_bytes.
While reading sysctl_tcp_limit_output_bytes, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 46d3cea ("tcp: TCP Small Queues") Signed-off-by: Kuniyuki Iwashima <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0f1e4d0 commit 9fb9019

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
@@ -2507,7 +2507,7 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb,
25072507
sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift));
25082508
if (sk->sk_pacing_status == SK_PACING_NONE)
25092509
limit = min_t(unsigned long, limit,
2510-
sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);
2510+
READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes));
25112511
limit <<= factor;
25122512

25132513
if (static_branch_unlikely(&tcp_tx_delay_enabled) &&

0 commit comments

Comments
 (0)