]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:23:23 +0000 (16:23 +0100)
commit42e02f251f53b74b87c7af1d94f566e1789bdde3
treee869d784f891565624231f07dfafc89c02497055
parentde934757ce0fbfa6d7e5c75509f559c3b45ac7f8
tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK

BugLink: https://bugs.launchpad.net/bugs/1860130
[ Upstream commit c9655008e7845bcfdaac10a1ed8554ec167aea88 ]

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: fd6dad616d4f ("[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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/ipv4/tcp_input.c