[Bug 296594] TCP: RFC 5961 sends a challenge ACK instead of resetting when a valid RST arrives with SEG.SEQ == RCV.NXT and the receiver has delayed-ACKed data, leaving the connection half-open

[email protected] Mon, 03 Aug 2026 11:16:58 +0000
Newsgroups gmane.os.freebsd.devel.net
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D296594

--- Comment #9 from [email protected] ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3Dc9df1a6cf9be9d44eacc8616ebba1cd19=
010c7fc

commit c9df1a6cf9be9d44eacc8616ebba1cd19010c7fc
Author:     Michael Tuexen <[email protected]>
AuthorDate: 2026-08-03 11:07:32 +0000
Commit:     Michael Tuexen <[email protected]>
CommitDate: 2026-08-03 11:07:32 +0000

    tcp: improve SEG.SEQ validation for RST segments

    A RST segment can be sent in response to
    (a) received segment or
    (b) by the upper layer protocol.

    The SEG.SEQ validation consists of two checks:
    (1) the in-window check of SEG.SEQ and
    (2) the exact match check of SEG.SEQ.

    For the in-window check (1), the left edge of the window needs to be
    based on tp->last_ack_sent to cover the delayed ACK case, whereas the
    right edge needs to be based on tp->rcv_nxt + tp->rcv_wnd. This both
    assumes that tp->rcv_wnd is not zero. For the special case of
    tp->rcv_wnd being zero, add checks against tp->last_ack_sent for (a)
    and on tp->rcv_nxt for (b). This applies to all TCP stacks.

    When the exact match (2) of SEG.SEQ is performed, it should be based
    on tp->last_ack_sent for (a) and on tp->rcv_nxt for (b). To cover both,
    check for both. Add this only to the base stack, since the RACK and
    BBR stacks already do this.

    PR:                     296594
    Reviewed by:            rscheff
    MFC after:              3 days
    MFC to:                 stable/14
    MFC to:                 stable/15
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D58594

 sys/netinet/tcp_input.c                  | 18 ++++++++++++------
 sys/netinet/tcp_stacks/rack_bbr_common.c | 22 ++++++++++++++--------
 2 files changed, 26 insertions(+), 14 deletions(-)

--=20
You are receiving this mail because:
You are on the CC list for the bug.=