mirror of https://github.com/OISF/suricata
flow/bypass: use_cnt desync'd on bypassed flows
Locally bypassed flows had unsafe updates to `Flow::use_cnt` leading to a race issue. For a packet it would do the flow lookup, attach the flow to the packet, increment the `use_cnt`. Then it would detect that the flow is in the bypass state, and unlock it while holding a reference (so alos not decrementing the `use_cnt`). When the packet was then returned to the packet pool, the flow would be disconnected from the packet, which would decrement `use_cnt` without holding the flow lock. This patch addresses this issue by disconnecting the flow from the packet immediately when the bypassed state is detected. This moves the `use_cnt` decrement to within the lock. Bug: #4766.pull/6538/head
parent
416575ea02
commit
ec7e0561e8
Loading…
Reference in New Issue