]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect: fix FNs in case of too many prefilter engines 6415/head
authorVictor Julien <victor@inliniac.net>
Tue, 28 Sep 2021 10:28:54 +0000 (12:28 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 28 Sep 2021 12:18:22 +0000 (14:18 +0200)
commit1a4288ff2be7f1d461de7153b7ee014bcaca3a29
treee8e7050e64c644b925cffa4b0073857fcec34e52
parent81c69694554d84d507edd5c3c8e98d39851fcfd2
detect: fix FNs in case of too many prefilter engines

Fix FNs in case of too many prefilter engines. A transaction was tracking
which engines have run using a u64 bit array. The engines 'local_id' was
used to set and check this bit. However the bit checking code didn't
handle int types correctly, leading to an incorrect left shift result of
a u32 to a u64 bit value.

This commit addresses that by fixing the int handling.

This is only a partial fix however. It's not hard to craft a ruleset that
exceeds the 63-bit space available. A more complete fix is in:

932cf0b6a6ad ("detect: track prefilter by progress, not engine")

However this seems like a too high risk change for a backport into
5.0.

This patch does issue a warning if the condition is detected at start
up, and `-T` does error out on it.

Bug: #4688.
src/detect-engine-prefilter.c