]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect: reset signature groups when reversing flow
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 25 Feb 2025 09:49:41 +0000 (10:49 +0100)
committerPhilippe Antoine <pantoine@oisf.net>
Fri, 7 Mar 2025 17:05:05 +0000 (18:05 +0100)
commit1907b9f225ca8e0f8592a60638024f668b509034
tree7802811aef2ebd88d03a817679113afdcc0c7b1b
parentda092a5d839b0cd2c51ff6df43dfa87d25fdd969
detect: reset signature groups when reversing flow

Ticket: 7552

When we use midstream, and the first packet we see of a flow is
a response from server, and we want to match on some signature
to client :
- we had first set sgh_toserver/FLOW_SGH_TOSERVER as we first
  thought this was a packet to server
- we then swap/reverse the flow, so sgh_toclient becomes sgh_toserver
  but it contains signatures to server and cannot match our
  to_client signature

The detect engine with DetectRunSetup will set again the
signatures group heads properly

(cherry picked from commit d74bc774b75bcca613e5f48d907a425c3b46056a)
src/app-layer.c