summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-22 01:55:38 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-22 01:55:38 +0200
commit3130514bd99bdc4cf8a51e24be2d8bf6f1e47f62 (patch)
tree64665226043d32938c50519682d379eb478b7846
parent45e1c359c23b3fb1ba419aac9fb7450d0cdbcd72 (diff)
exec: Leave room for mmaps etc. before PIE binaries
otherwise there might not even be enough room to run RPCs during rtld bootstrap. * exec/exec.c (do_exec): Add 128MiB to anywhere_start before loading program.
-rw-r--r--exec/exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/exec/exec.c b/exec/exec.c
index ccf7bb36..3b4978d2 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1285,6 +1285,9 @@ do_exec (file_t file,
}
+ /* Leave room for mmaps etc. before PIE binaries.
+ * Could add address randomization here. */
+ anywhere_start += 128 << 20;
/* Load the file into the task. */
anywhere_start = load (newtask, &e, anywhere_start);
if (e.error)