stream: RST no longer acks all data #12300
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since forever (1578ef1) 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 movinglast_ack
addresses the GAP false positives.Ticket: #7422.
Rebases #12186.
SV_BRANCH=OISF/suricata-verify#2154
https://redmine.openinfosecfoundation.org/issues/7422