Skip to content

Commit e1b28db

Browse files
author
Guillaume Nault
committed
tcp: Fix a data-race around sysctl_tcp_comp_sack_nr.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2160073 Upstream Status: linux.git commit 79f5547 Author: Kuniyuki Iwashima <kuniyu@amazon.com> Date: Fri Jul 22 11:22:03 2022 -0700 tcp: Fix a data-race around sysctl_tcp_comp_sack_nr. While reading sysctl_tcp_comp_sack_nr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 9c21d2f ("tcp: add tcp_comp_sack_nr sysctl") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guillaume Nault <gnault@redhat.com>
1 parent ba3a173 commit e1b28db

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
@@ -5478,7 +5478,7 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
54785478
}
54795479

54805480
if (!tcp_is_sack(tp) ||
5481-
tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr)
5481+
tp->compressed_ack >= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr))
54825482
goto send_now;
54835483

54845484
if (tp->compressed_ack_rcv_nxt != tp->rcv_nxt) {

0 commit comments

Comments
 (0)