]> git.ipfire.org Git - thirdparty/suricata.git/commit
thresholds: fix issues with host based thresholds 3233/head
authorVictor Julien <victor@inliniac.net>
Tue, 16 Jan 2018 10:54:39 +0000 (11:54 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 12 Feb 2018 09:02:08 +0000 (10:02 +0100)
commit2b9d24203373ceb13331b74255f6297334914fac
treeb26dfc34c66a2a7cc4a159eb55c4b6b2f9508b13
parent660c1de7ba7657e32e89cea0b16d51b265eaeb6e
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