summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2021-10-19 17:14:04 +0100
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-10-29 18:08:58 +0000
commit1a0453876f3cd780713f6b054ba97eeaa326b97a (patch)
treefb530e0d302071bab9b3cbfdfe2e7ce424596520
parent3614aaf4d4874b1e0faaf7648327d2448b015add (diff)
Allow PROT_EXEC on the zygote mappings when falling back to ashmem
Because we now protect the mappings before creating the executable one, we need to also allow PROT_EXEC on an ashmem region. Test: manually change code to use ashmem, build, see that JIT is created. Bug: 202999239 Merged-In: I9f2944c45f4ff607c7e341552c82138bfe13cca4 (cherry picked from commit 8c63ce27d4d3e87f535769976e9b9185fa372b9b) Change-Id: I8a5e9655e6c40404389344e78c21b0ebd5a1a4b9 (cherry picked from commit 94e2fc9465e9a2c9d62902b09ed9a18d9250ccd8)
-rw-r--r--runtime/jit/jit_memory_region.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/jit/jit_memory_region.cc b/runtime/jit/jit_memory_region.cc
index b0699c42d3..56407f58c0 100644
--- a/runtime/jit/jit_memory_region.cc
+++ b/runtime/jit/jit_memory_region.cc
@@ -556,7 +556,7 @@ bool JitMemoryRegion::ProtectZygoteMemory(int fd, std::string* error_msg) {
return false;
}
} else {
- palette_status_t status = PaletteAshmemSetProtRegion(fd, PROT_READ);
+ palette_status_t status = PaletteAshmemSetProtRegion(fd, PROT_READ | PROT_EXEC);
if (status != PALETTE_STATUS_OK) {
CHECK_EQ(status, PALETTE_STATUS_CHECK_ERRNO);
std::ostringstream oss;