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 <pantoine@oisf.net>
pull/13767/head
Shivani Bhardwaj 3 months ago committed by Victor Julien
parent d0a513df6a
commit b7866b8043

@ -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);

Loading…
Cancel
Save