]> git.ipfire.org Git - thirdparty/suricata.git/commit
flow/manager: fix multi instance row tracking 12302/head
authorVictor Julien <vjulien@oisf.net>
Tue, 3 Dec 2024 10:36:27 +0000 (11:36 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 17 Dec 2024 21:05:21 +0000 (22:05 +0100)
commit9e24f12027d86b108b5ece21e35c01cec121b7a0
tree127df1949738294ef5092709ae6fd37e5e7b1b78
parent206daeef453ca907226a7397ed10406f6f8499de
flow/manager: fix multi instance row tracking

In multi instance flow manager setups, each flow manager gets a slice
of the hash table to manage. Due to a logic error in the chunked
scanning of the hash slice, instances beyond the first would always
rescan the same (first) subslice of their slice.

The `pos` variable that is used to keep the state of what the starting
position for the next scan was supposed to be, was treated as if it held
a relative value. Relative to the bounds of the slice. It was however,
holding an absolute position. This meant that when doing it's bounds
check it was always considered out of bounds. This would reset the sub-
slice to be scanned to the first part of the instances slice.

This patch addresses the issue by correctly handling the fact that the
value is absolute.

Bug: #7365.

Fixes: e9d2417e0ff3 ("flow/manager: adaptive hash eviction timing")
(cherry picked from commit ae072d5c07e0f5e02a8583127c7b3edd97f93d54)
src/flow-manager.c