Fix: add mutex protection in mcast_membership_report_on_query to prevent data race condition#1302
Fix: add mutex protection in mcast_membership_report_on_query to prevent data race condition#1302
Conversation
soopel
left a comment
There was a problem hiding this comment.
Please check if there is no deadlock created by adding this mutex.
Here is analysis by AI Analysis Summary: ✅ No deadlock risk detected! Here's why: Functions that lock group_mutex: mcast_membership_report_on_query (our fix) - line 192 rte_pktmbuf_alloc - DPDK function, no mutex mcast_membership_report_cb (timer callback) - no mutex usage None of the callers hold group_mutex before calling the function No nested locking of the same mutex |
…rship_report_on_query Protect access to mcast->group_num and mcast->group_list with group_mutex to prevent data race conditions. These fields are written with the mutex held elsewhere, so reads must also be protected. - Acquire group_mutex before reading group_num - Keep mutex held during TAILQ_FOREACH iteration of group_list - Add proper unlock on all early return paths (no groups, alloc failure)
31d9eae to
3d41f60
Compare
No description provided.