Patch "tcp: Fix data-races around sysctl_tcp_moderate_rcvbuf." has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tcp: Fix data-races around sysctl_tcp_moderate_rcvbuf.

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-data-races-around-sysctl_tcp_moderate_rcvbuf.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 780476488844e070580bfc9e3bc7832ec1cea883 Mon Sep 17 00:00:00 2001
From: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Date: Wed, 20 Jul 2022 09:50:18 -0700
Subject: tcp: Fix data-races around sysctl_tcp_moderate_rcvbuf.

From: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>

commit 780476488844e070580bfc9e3bc7832ec1cea883 upstream.

While reading sysctl_tcp_moderate_rcvbuf, it can be changed
concurrently.  Thus, we need to add READ_ONCE() to its readers.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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_input.c |    2 +-
 net/mptcp/protocol.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -693,7 +693,7 @@ void tcp_rcv_space_adjust(struct sock *s
 	 * <prev RTT . ><current RTT .. ><next RTT .... >
 	 */
 
-	if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf &&
+	if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf) &&
 	    !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
 		int rcvmem, rcvbuf;
 		u64 rcvwin, grow;
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1421,7 +1421,7 @@ static void mptcp_rcv_space_adjust(struc
 	if (msk->rcvq_space.copied <= msk->rcvq_space.space)
 		goto new_measure;
 
-	if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf &&
+	if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf) &&
 	    !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
 		int rcvmem, rcvbuf;
 		u64 rcvwin, grow;


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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux