]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK
authorPengcheng Yang <yangpc@wangsu.com>
Mon, 30 Dec 2019 09:54:41 +0000 (17:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jan 2020 23:42:28 +0000 (15:42 -0800)
commite1e0241e1d1cfdcca0f867764e2a06859c6cd9f8
tree47f88a850061d17b1635abe37ab0d17238a479a5
parent93c0fc9814e43ae1b4b38c09683c14de90028703
tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK

When we receive a D-SACK, where the sequence number satisfies:
undo_marker <= start_seq < end_seq <= prior_snd_una
we consider this is a valid D-SACK and tcp_is_sackblock_valid()
returns true, then this D-SACK is discarded as "old stuff",
but the variable first_sack_index is not marked as negative
in tcp_sacktag_write_queue().

If this D-SACK also carries a SACK that needs to be processed
(for example, the previous SACK segment was lost), this SACK
will be treated as a D-SACK in the following processing of
tcp_sacktag_write_queue(), which will eventually lead to
incorrect updates of undo_retrans and reordering.

Fixes: 11eabbb4a020 ("[TCP]: Earlier SACK block verification & simplify access to them")
Signed-off-by: Pengcheng Yang <yangpc@wangsu.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c