]> git.ipfire.org Git - thirdparty/suricata.git/commit
stream: RST no longer acks all data 12371/head
authorVictor Julien <vjulien@oisf.net>
Fri, 29 Nov 2024 13:37:08 +0000 (14:37 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2025 08:16:36 +0000 (09:16 +0100)
commitbd1b9f62299422767056651f8f66d2bbd4e0bb14
treef82fa183ec5c1a0ffc21ce9ebd7fe9d7edd67b9f
parent829ba7d1147924d77bf51de558be38e3e1a93a6b
stream: RST no longer acks all data

Since forever (1578ef1e3e8a24d0cc615430c4e6bec1fefdad28) a valid RST
would update the internal `last_ack` representation to include all
unack'd data. This was originally done to make sure the unACK'd data was
inspected/processed at flow timeout.

It was observed however, that if GAPs existed in this unACK'd data, a
GAP could be reported in the stats and a GAP event would be raised. This
doesn't make sense, as missing segments in the unACK'd part of the
stream are completely normal. Segments simply do not all arrive in
order.

It turns out that the original behavior of updating `last_ack` to
include all unACK'd data is no longer needed.

For raw stream inspection, the detection engine will already include the
unACK'd data on flow end.

For app-layer updates the unACK'd data is often harmful, as the data
often has GAPs. Parser like the http parser would report these GAPs and
could also get confused about the post-GAP data being a new transaction
including a file. This lead to many reported errors and fantom txs and
files.

Since the GAP detection uses `last_ack` to determine GAPs, not moving
`last_ack` addresses the GAP false positives.

Ticket: #7422.
src/stream-tcp.c