base: fix native crash in system_server
Currently PackageManagerService uses multi-thread to scan packages to speed up, when scan each package, it sometimes will call SELinux's restorecon, then libselinux uses global variable fc_sehandle to selabel_lookup and write in compile_regex, so it's not thread-safe, so will cause invalid address with possibility. From backtrace, the final crash happens in pcre_exec. Add one lock in NativeLibraryHelper to make restorecon safe. Change-Id: I2f00b4d66d968642f1726c28f4f6dc766c1cdad7 CRs-Fixed: 1002406, 1027381
Loading
Please register or sign in to comment