From b7866b8043d57f09f271684e0e6a3cbf29699e06 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Thu, 28 Aug 2025 08:06:44 +0530 Subject: [PATCH] stream: remove incorrect defensive check 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 --- src/stream-tcp-reassemble.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 651b7f512d..a7a33154a2 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -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);