]> git.ipfire.org Git - thirdparty/suricata.git/commit
thresholds: fix issues with host based thresholds 3168/head
authorVictor Julien <victor@inliniac.net>
Tue, 16 Jan 2018 10:54:39 +0000 (11:54 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 17 Jan 2018 13:49:50 +0000 (14:49 +0100)
commit50a762bfd164e27c55624c7e4f7e3c2e064ca788
tree50c542cfe380f4a99b20f36a38d398f5df10b15c
parent4b24d965b8081c86759ef80080c50787d66f4727
thresholds: fix issues with host based thresholds

The flow manager thread (that also runs the host cleanup code) would
sometimes free a host before it's thresholds are timed out. This would
lead to misdetection or too many alerts.

This was mostly (only?) visible on slower systems. And was caused by a
mismatch between time concepts of the async flow manager thread and the
packet threads, resulting in the flow manager using a timestamp that
was before the threshold entry creation ts. This would lead to an
integer underflow in the timeout check, leading to a incorrect conclusion
that the threshold entry was timed out.

To address this,  check if the 'check' timestamp is not before the creation
timestamp.
src/detect-engine-threshold.c