__loader_cfi_fail: acquire g_dl_mutex

CfiFail calls find_containing_library, which searches the linker's
internal soinfo list, which could be modified by another thread.

Bug: http://b/150372650
Test: bionic-unit-tests
Change-Id: I59024a0a47913caa75702f15ec058b0a360727b5
This commit is contained in:
Ryan Prichard 2020-04-20 18:01:00 -07:00
parent c2a93792fc
commit 172611f5ce

View file

@ -284,6 +284,7 @@ android_namespace_t* __loader_android_get_exported_namespace(const char* name) {
}
void __loader_cfi_fail(uint64_t CallSiteTypeId, void* Ptr, void *DiagData, void *CallerPc) {
ScopedPthreadMutexLocker locker(&g_dl_mutex);
CFIShadowWriter::CfiFail(CallSiteTypeId, Ptr, DiagData, CallerPc);
}