From 12e44050c93cc88cc03fbfc11b41552e27b1c385 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Mon, 2 Apr 2018 20:12:54 +0900 Subject: [PATCH] mcexec: drop READ_IMPLIES_EXEC from personality to avoid device file mapping failure --- executer/user/mcexec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index a8fac77c..092e1c7e 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -1856,8 +1856,14 @@ int main(int argc, char **argv) altroot = "/usr/linux-k1om-4.7/linux-k1om"; } - /* Disable address space layout randomization */ + /* Disable READ_IMPLIES_EXEC */ persona = personality(0xffffffff); + if (persona & READ_IMPLIES_EXEC) { + persona &= ~READ_IMPLIES_EXEC; + persona = personality(persona); + } + + /* Disable address space layout randomization */ __dprintf("persona=%08x\n", persona); if ((persona & (PER_LINUX | ADDR_NO_RANDOMIZE)) == 0) { CHKANDJUMP(getenv("MCEXEC_ADDR_NO_RANDOMIZE"), 1, "personality() and then execv() failed\n");