Patch "tcp: fix tp->undo_retrans accounting in tcp_sacktag_one()" has been added to the 5.14-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 tp->undo_retrans accounting in tcp_sacktag_one()

to the 5.14-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-tp-undo_retrans-accounting-in-tcp_sacktag_on.patch
and it can be found in the queue-5.14 subdirectory.

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



commit 461efe3ffdd79f55bbe3148a63988e7483c37b89
Author: zhenggy <zhenggy@xxxxxxxxxxxxxxx>
Date:   Tue Sep 14 09:51:15 2021 +0800

    tcp: fix tp->undo_retrans accounting in tcp_sacktag_one()
    
    [ Upstream commit 4f884f3962767877d7aabbc1ec124d2c307a4257 ]
    
    Commit 10d3be569243 ("tcp-tso: do not split TSO packets at retransmit
    time") may directly retrans a multiple segments TSO/GSO packet without
    split, Since this commit, we can no longer assume that a retransmitted
    packet is a single segment.
    
    This patch fixes the tp->undo_retrans accounting in tcp_sacktag_one()
    that use the actual segments(pcount) of the retransmitted packet.
    
    Before that commit (10d3be569243), the assumption underlying the
    tp->undo_retrans-- seems correct.
    
    Fixes: 10d3be569243 ("tcp-tso: do not split TSO packets at retransmit time")
    Signed-off-by: zhenggy <zhenggy@xxxxxxxxxxxxxxx>
    Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Acked-by: Yuchung Cheng <ycheng@xxxxxxxxxx>
    Acked-by: Neal Cardwell <ncardwell@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 149ceb5c94ff..66d9085da87e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1314,7 +1314,7 @@ static u8 tcp_sacktag_one(struct sock *sk,
 	if (dup_sack && (sacked & TCPCB_RETRANS)) {
 		if (tp->undo_marker && tp->undo_retrans > 0 &&
 		    after(end_seq, tp->undo_marker))
-			tp->undo_retrans--;
+			tp->undo_retrans = max_t(int, 0, tp->undo_retrans - pcount);
 		if ((sacked & TCPCB_SACKED_ACKED) &&
 		    before(start_seq, state->reord))
 				state->reord = start_seq;



[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