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 |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| infra/config | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| tools/cmake_generate_graphviz | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CMakeSettings.json | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| DIR_METADATA | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| codereview.settings | Loading commit data... |