Skip to content

Commit ba3a173

Browse files
author
Guillaume Nault
committed
tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2160073 Upstream Status: linux.git commit 2239694 Author: Kuniyuki Iwashima <kuniyu@amazon.com> Date: Fri Jul 22 11:22:02 2022 -0700 tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns. While reading sysctl_tcp_comp_sack_slack_ns, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: a70437c ("tcp: add hrtimer slack to sack compression") 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 864f6cb commit ba3a173

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
@@ -5504,7 +5504,7 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
55045504
rtt * (NSEC_PER_USEC >> 3)/20);
55055505
sock_hold(sk);
55065506
hrtimer_start_range_ns(&tp->compressed_ack_timer, ns_to_ktime(delay),
5507-
sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns,
5507+
READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns),
55085508
HRTIMER_MODE_REL_PINNED_SOFT);
55095509
}
55105510

0 commit comments

Comments
 (0)