forked from OISF/suricata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
threading: don't pass locked flow between threads
Previously the flow manager would share evicted flows with the workers while keeping the flows mutex locked. This reduced the number of unlock/ lock cycles while there was guaranteed to be no contention. This turns out to be undefined behavior. A lock is supposed to be locked and unlocked from the same thread. It appears that FreeBSD is stricter on this than Linux. This patch addresses the issue by unlocking before handing a flow off to another thread, and locking again from the new thread. Issue was reported and largely analyzed by Bill Meeks. Bug: OISF#4478
- Loading branch information
1 parent
9d24a53
commit abd44fc
Showing
4 changed files
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters