This is a note to let you know that I've just added the patch titled tcp: Fix a data-race around sysctl_tcp_limit_output_bytes. to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tcp-fix-a-data-race-around-sysctl_tcp_limit_output_bytes.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 9fb90193fbd66b4c5409ef729fd081861f8b6351 Mon Sep 17 00:00:00 2001 From: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> Date: Wed, 20 Jul 2022 09:50:20 -0700 Subject: tcp: Fix a data-race around sysctl_tcp_limit_output_bytes. From: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> commit 9fb90193fbd66b4c5409ef729fd081861f8b6351 upstream. While reading sysctl_tcp_limit_output_bytes, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 46d3ceabd8d9 ("tcp: TCP Small Queues") Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2499,7 +2499,7 @@ static bool tcp_small_queue_check(struct sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift)); if (sk->sk_pacing_status == SK_PACING_NONE) limit = min_t(unsigned long, limit, - sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes); + READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes)); limit <<= factor; if (static_branch_unlikely(&tcp_tx_delay_enabled) && Patches currently in stable-queue which might be from kuniyu@xxxxxxxxxx are queue-5.10/tcp-fix-a-data-race-around-sysctl_tcp_app_win.patch queue-5.10/tcp-fix-a-data-race-around-sysctl_tcp_limit_output_bytes.patch queue-5.10/tcp-fix-a-data-race-around-sysctl_tcp_nometrics_save.patch queue-5.10/tcp-fix-data-races-around-sysctl_tcp_no_ssthresh_metrics_save.patch queue-5.10/tcp-fix-a-data-race-around-sysctl_tcp_adv_win_scale.patch queue-5.10/tcp-fix-a-data-race-around-sysctl_tcp_frto.patch queue-5.10/tcp-fix-data-races-around-sysctl_tcp_dsack.patch queue-5.10/tcp-fix-a-data-race-around-sysctl_tcp_challenge_ack_limit.patch queue-5.10/tcp-fix-data-races-around-sysctl_tcp_moderate_rcvbuf.patch queue-5.10/net-ping6-fix-memleak-in-ipv6_renew_options.patch