forked from zephyrproject-rtos/zephyr
-
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.
net: conn: Improve thread safety in connection module
Iterating over connection list w/o mutex lock could lead to a crash on constant incoming packet flow. Fix this by: 1. Adding mutex lock when iterating over an active connection list, to prevent list corruption. 2. Create a copy of the callback and user data pointers before releasing lock, to prevent NULL pointer dereference in case connection is released before callback is executed. Signed-off-by: Robert Lubos <[email protected]>
- Loading branch information
1 parent
4ab2dde
commit 5f6b447
Showing
1 changed file
with
17 additions
and
4 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