summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-18 15:33:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-18 15:33:09 -0700
commit909eacd748b3c8d15e6a239aa67f7828885d798e (patch)
tree87f88e6c53800a3f9b8cc0867845cf116c7416fe /fs/exec.c
parentaa519be34f45954f33a6c20430deac8e544a180f (diff)
parente26081808edadfd257c6c9d81014e3b25e9a6118 (diff)
Merge 4.1-rc4 into usb-next
We want the fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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;