summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-05-18 10:50:43 -0700
committerBrian Norris <computersforpeace@gmail.com>2015-05-18 10:50:43 -0700
commit2ddd8db90a22fc4ac708cd8497ed5e46b7f24d49 (patch)
tree10924a4ec59c9b2d114c2287bd35e6debc72595f /fs/exec.c
parent02787daadbdad80c9c79487b5ef8284aff734a7b (diff)
parente26081808edadfd257c6c9d81014e3b25e9a6118 (diff)
Merge tag 'v4.1-rc4' into MTD's -next
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 49a1c61433b7..1977c2a553ac 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -659,6 +659,9 @@ int setup_arg_pages(struct linux_binprm *bprm,
if (stack_base > STACK_SIZE_MAX)
stack_base = STACK_SIZE_MAX;
+ /* Add space for stack randomization. */
+ stack_base += (STACK_RND_MASK << PAGE_SHIFT);
+
/* Make sure we didn't let the argument array grow too large. */
if (vma->vm_end - vma->vm_start > stack_base)
return -ENOMEM;