Skip to content

Commit 92de1ca

Browse files
author
Paolo Abeni
committed
tcp: fix tcp_ofo_queue() to avoid including too much DUP SACK range
JIRA: https://issues.redhat.com/browse/RHEL-115580 Upstream commit: commit a041f70 Author: xin.guo <guoxin0309@gmail.com> Date: Thu Jun 26 12:34:19 2025 +0000 tcp: fix tcp_ofo_queue() to avoid including too much DUP SACK range If the new coming segment covers more than one skbs in the ofo queue, and which seq is equal to rcv_nxt, then the sequence range that is duplicated will be sent as DUP SACK, the detail as below, in step6, the {501,2001} range is clearly including too much DUP SACK range, in violation of RFC 2883 rules. 1. client > server: Flags [.], seq 501:1001, ack 1325288529, win 20000, length 500 2. server > client: Flags [.], ack 1, [nop,nop,sack 1 {501:1001}], length 0 3. client > server: Flags [.], seq 1501:2001, ack 1325288529, win 20000, length 500 4. server > client: Flags [.], ack 1, [nop,nop,sack 2 {1501:2001} {501:1001}], length 0 5. client > server: Flags [.], seq 1:2001, ack 1325288529, win 20000, length 2000 6. server > client: Flags [.], ack 2001, [nop,nop,sack 1 {501:2001}], length 0 After this fix, the final ACK is as below: 6. server > client: Flags [.], ack 2001, options [nop,nop,sack 1 {501:1001}], length 0 [edumazet] added a new packetdrill test in the following patch. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: xin.guo <guoxin0309@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250626123420.1933835-2-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent e933bf8 commit 92de1ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4974,8 +4974,9 @@ static void tcp_ofo_queue(struct sock *sk)
49744974

49754975
if (before(TCP_SKB_CB(skb)->seq, dsack_high)) {
49764976
__u32 dsack = dsack_high;
4977+
49774978
if (before(TCP_SKB_CB(skb)->end_seq, dsack_high))
4978-
dsack_high = TCP_SKB_CB(skb)->end_seq;
4979+
dsack = TCP_SKB_CB(skb)->end_seq;
49794980
tcp_dsack_extend(sk, TCP_SKB_CB(skb)->seq, dsack);
49804981
}
49814982
p = rb_next(p);

0 commit comments

Comments
 (0)