summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2021-10-19 17:14:04 +0100
committerNicolas Geoffray <ngeoffray@google.com>2021-10-20 13:51:50 +0100
commit94e2fc9465e9a2c9d62902b09ed9a18d9250ccd8 (patch)
tree9de3173e5b68e49558568116245174b6feddb14b
parentc95b63042306aba985bb2902663c759b38b0ac81 (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
-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;