Patch "tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns." has been added to the 5.15-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 a data-race around sysctl_tcp_comp_sack_slack_ns.

to the 5.15-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_comp_sack_slac.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d01503cad72cd3674173d67418ac2e164136ede7
Author: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
Date:   Fri Jul 22 11:22:02 2022 -0700

    tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns.
    
    [ Upstream commit 22396941a7f343d704738360f9ef0e6576489d43 ]
    
    While reading sysctl_tcp_comp_sack_slack_ns, it can be changed
    concurrently.  Thus, we need to add READ_ONCE() to its reader.
    
    Fixes: a70437cc09a1 ("tcp: add hrtimer slack to sack compression")
    Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 486ca1d5b436..7b593865b4ae 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5517,7 +5517,7 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
 		      rtt * (NSEC_PER_USEC >> 3)/20);
 	sock_hold(sk);
 	hrtimer_start_range_ns(&tp->compressed_ack_timer, ns_to_ktime(delay),
-			       sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns,
+			       READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns),
 			       HRTIMER_MODE_REL_PINNED_SOFT);
 }
 



[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