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
Change-Id: I9f2944c45f4ff607c7e341552c82138bfe13cca4
diff --git a/runtime/jit/jit_memory_region.cc b/runtime/jit/jit_memory_region.cc
index 58a4041..1592767 100644
--- a/runtime/jit/jit_memory_region.cc
+++ b/runtime/jit/jit_memory_region.cc
@@ -552,7 +552,7 @@
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;