Using a memfd name to annotate swiftshader_jit allocations is quite clever, but it doesn't work on Android because memfds can be shared and so writing to mappings of them promotes CoW/shared, which is classified by selinux as 'execmod' permission. Android prohibits 'execmod' permission for new app processes, because this is usually a sign the app relies on shared text relocations, which are insecure. In this case, that isn't actually happening, but we are subject to the same blanket ban :) Fortunately, Android has a longtime non-upstreamed prctl() to allow private mappings to be named as well, PR_SET_VMA_ANON_NAME. As this isn't generally available for Linux, wrap it in checks for __ANDROID__. This enables the naming without tripping the 'execmod' permission check. Bug: b/171498948 Bug: b/174801963 Change-Id: Ic4375bc4407e21ecdafb42a7cec651dc3b2ad13e Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52669Reviewed-by:Jason Macnak <natsu@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Jason Macnak <natsu@google.com> Tested-by:
Jason Macnak <natsu@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Commit-Queue: Jason Macnak <natsu@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CPUID.cpp | Loading commit data... | |
| CPUID.hpp | Loading commit data... | |
| Coroutine.hpp | Loading commit data... | |
| Debug.cpp | Loading commit data... | |
| Debug.hpp | Loading commit data... | |
| EmulatedIntrinsics.cpp | Loading commit data... | |
| EmulatedIntrinsics.hpp | Loading commit data... | |
| ExecutableMemory.cpp | Loading commit data... | |
| ExecutableMemory.hpp | Loading commit data... | |
| LLVMAsm.cpp | Loading commit data... | |
| LLVMAsm.hpp | Loading commit data... | |
| LLVMJIT.cpp | Loading commit data... | |
| LLVMReactor.cpp | Loading commit data... | |
| LLVMReactor.hpp | Loading commit data... | |
| LLVMReactorDebugInfo.cpp | Loading commit data... | |
| LLVMReactorDebugInfo.hpp | Loading commit data... | |
| Nucleus.hpp | Loading commit data... | |
| OptimalIntrinsics.cpp | Loading commit data... | |
| OptimalIntrinsics.hpp | Loading commit data... | |
| Optimizer.cpp | Loading commit data... | |
| Optimizer.hpp | Loading commit data... | |
| Print.hpp | Loading commit data... | |
| Reactor.cpp | Loading commit data... | |
| Reactor.hpp | Loading commit data... | |
| ReactorDebugInfo.cpp | Loading commit data... | |
| ReactorDebugInfo.hpp | Loading commit data... | |
| Routine.hpp | Loading commit data... | |
| SubzeroReactor.cpp | Loading commit data... | |
| Traits.hpp | Loading commit data... | |
| Traits.inl | Loading commit data... | |
| reactor.gni | Loading commit data... | |
| x86.hpp | Loading commit data... |