From 1a0453876f3cd780713f6b054ba97eeaa326b97a Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Tue, 19 Oct 2021 17:14:04 +0100 Subject: 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) --- runtime/jit/jit_memory_region.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3