Patch "tcp: fix TFO SYN_RECV to not zero retrans_stamp with retransmits out" has been added to the 6.6-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 TFO SYN_RECV to not zero retrans_stamp with retransmits out

to the 6.6-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-tfo-syn_recv-to-not-zero-retrans_stamp-with-.patch
and it can be found in the queue-6.6 subdirectory.

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



commit bd8a0a6db09057c3df7254cea717b1b3d27fd134
Author: Neal Cardwell <ncardwell@xxxxxxxxxx>
Date:   Tue Oct 1 20:05:17 2024 +0000

    tcp: fix TFO SYN_RECV to not zero retrans_stamp with retransmits out
    
    [ Upstream commit 27c80efcc20486c82698f05f00e288b44513c86b ]
    
    Fix tcp_rcv_synrecv_state_fastopen() to not zero retrans_stamp
    if retransmits are outstanding.
    
    tcp_fastopen_synack_timer() sets retrans_stamp, so typically we'll
    need to zero retrans_stamp here to prevent spurious
    retransmits_timed_out(). The logic to zero retrans_stamp is from this
    2019 commit:
    
    commit cd736d8b67fb ("tcp: fix retrans timestamp on passive Fast Open")
    
    However, in the corner case where the ACK of our TFO SYNACK carried
    some SACK blocks that caused us to enter TCP_CA_Recovery then that
    non-zero retrans_stamp corresponds to the active fast recovery, and we
    need to leave retrans_stamp with its current non-zero value, for
    correct ETIMEDOUT and undo behavior.
    
    Fixes: cd736d8b67fb ("tcp: fix retrans timestamp on passive Fast Open")
    Signed-off-by: Neal Cardwell <ncardwell@xxxxxxxxxx>
    Signed-off-by: Yuchung Cheng <ycheng@xxxxxxxxxx>
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241001200517.2756803-4-ncardwell.sw@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d472f7052cd32..fb053942dba2a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6554,10 +6554,17 @@ static void tcp_rcv_synrecv_state_fastopen(struct sock *sk)
 	if (inet_csk(sk)->icsk_ca_state == TCP_CA_Loss && !tp->packets_out)
 		tcp_try_undo_recovery(sk);
 
-	/* Reset rtx states to prevent spurious retransmits_timed_out() */
 	tcp_update_rto_time(tp);
-	tp->retrans_stamp = 0;
 	inet_csk(sk)->icsk_retransmits = 0;
+	/* In tcp_fastopen_synack_timer() on the first SYNACK RTO we set
+	 * retrans_stamp but don't enter CA_Loss, so in case that happened we
+	 * need to zero retrans_stamp here to prevent spurious
+	 * retransmits_timed_out(). However, if the ACK of our SYNACK caused us
+	 * to enter CA_Recovery then we need to leave retrans_stamp as it was
+	 * set entering CA_Recovery, for correct retransmits_timed_out() and
+	 * undo behavior.
+	 */
+	tcp_retrans_stamp_cleanup(sk);
 
 	/* Once we leave TCP_SYN_RECV or TCP_FIN_WAIT_1,
 	 * we no longer need req so release it.




[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