]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: remove incorrect defensive check
authorShivani Bhardwaj <shivani@oisf.net>
Thu, 28 Aug 2025 02:36:44 +0000 (08:06 +0530)
committerVictor Julien <victor@inliniac.net>
Fri, 29 Aug 2025 07:09:45 +0000 (09:09 +0200)
As a part of the commit d096b98 a defensive check was added stating that
the stream must have EOF flag set if it is in TCP_CLOSING state or
above. However, this led to a false positive reported by oss-fuzz whose
analysis showed that this does not hold true for TCP_CLOSING state. It
does hold true only for TCP_CLOSED or if packet has PKT_PSEUDO_STREAM_END
set.
TCP_CLOSING state correspond to an established flow hence the correct
course of action is to remove the assertion.

Bug 7636

Co-authored-by: Philippe Antoine <pantoine@oisf.net>
src/stream-tcp-reassemble.c

index 651b7f512d59a40d6ce972be4681a1487d1ee8f4..a7a33154a2787ba2b6ae5b554fac85d19f73a5e6 100644 (file)
@@ -1421,7 +1421,6 @@ int StreamTcpReassembleAppLayer(ThreadVars *tv, TcpReassemblyThreadCtx *ra_ctx,
             SCLogDebug("sending empty eof message");
             /* send EOF to app layer */
             uint8_t stream_flags = StreamGetAppLayerFlags(ssn, stream, p);
-            DEBUG_VALIDATE_BUG_ON((stream_flags & STREAM_EOF) == 0);
             AppLayerHandleTCPData(
                     tv, ra_ctx, p, p->flow, ssn, &stream, NULL, 0, stream_flags, app_update_dir);
             AppLayerProfilingStore(ra_ctx->app_tctx, p);