libselinux: make threadsafe for discover_class_cache#336
libselinux: make threadsafe for discover_class_cache#336purushottamc wants to merge 1 commit intoSELinuxProject:masterfrom
Conversation
Crash is observed in process dbus-daemon while accessing name from discover_class_cache structure variable, discover_class_cache->name variable found NULL during backtrace analysis. Add mutex lock for the discover_class_cache to handle multiple threads for the function which uses discover_class_cache This avoids variable corruption during parallel access in the multiple thread environment.
|
I think there might still be an issue left: Also as by https://github.com/SELinuxProject/selinux/blob/master/CONTRIBUTING.md#contributing-code all patches require a Signed-off-by and needs to be send to selinux@vger.kernel.org. |
|
Hi @cgzones, |
Does it not build, are there issues in single thread mode, are there issues with multiple threads? For the multiple threads case: Another note on the sent patch: returning a copy from |
Crash is observed in process dbus-daemon while accessing name
from discover_class_cache structure variable,
discover_class_cache->name variable found NULL
during backtrace analysis.
Add mutex lock for the discover_class_cache to handle multiple
threads for the function which uses discover_class_cache
This avoids variable corruption during parallel access
in the multiple thread environment.