]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
policy: postpone evaluation of exception policy after setting the engine mode
authorLukas Sismis <lsismis@oisf.net>
Sun, 2 Apr 2023 08:41:08 +0000 (10:41 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 1 May 2023 14:40:29 +0000 (16:40 +0200)
Master exception policy queried engine mode earlier than it was
determined from the configuration file/command line. As a result it
used the default (IDS) mode. However, the engine mode could have been
reconfigured later on to the IPS mode. This lead into an undefined behavior
as master exception policy behaves according to the configured engine mode.

Ticket: #5960

src/suricata.c

index 29494f8ebfb231adc1f2d77b3a887efbcf4050e4..f2127d1a2e23c1b99512ac64dea7d6e530e950a6 100644 (file)
@@ -2671,13 +2671,13 @@ int PostConfLoadedSetup(SCInstance *suri)
 
     MacSetRegisterFlowStorage();
 
-    SetMasterExceptionPolicy();
-
     LiveDeviceFinalize(); // must be after EBPF extension registration
 
     RunModeEngineIsIPS(
             suricata.run_mode, suricata.runmode_custom_mode, suricata.capture_plugin_name);
 
+    SetMasterExceptionPolicy();
+
     AppLayerSetup();
 
     /* Suricata will use this umask if provided. By default it will use the