]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: fix false negative on bad RST
authorVictor Julien <victor@inliniac.net>
Fri, 18 Jan 2019 14:03:39 +0000 (15:03 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 24 Jan 2019 21:31:58 +0000 (22:31 +0100)
If a bad RST was received the stream inspection would not happen
for that packet, but it would still move the 'raw progress' tracker
forward. Following good packets would then fail to detect anything
before the 'raw progress' position.

Bug #2770

Reported-by: Alexey Vishnyakov
src/detect.c

index a7b2124d2b0b8fab179c3d67ccacae6c4ce0819e..5270b5649a43bff4e65c3b6f63075001348c49b5 100644 (file)
@@ -1039,7 +1039,9 @@ static void DetectRunCleanup(DetectEngineThreadCtx *det_ctx,
 
     if (pflow != NULL) {
         /* update inspected tracker for raw reassembly */
-        if (p->proto == IPPROTO_TCP && pflow->protoctx != NULL) {
+        if (p->proto == IPPROTO_TCP && pflow->protoctx != NULL &&
+            (p->flags & PKT_STREAM_EST))
+        {
             StreamReassembleRawUpdateProgress(pflow->protoctx, p,
                     det_ctx->raw_stream_progress);