aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 2d9455282744..1b63237fc6dc 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -594,6 +594,11 @@ int setup_arg_pages(struct linux_binprm *bprm,
594#else 594#else
595 stack_top = arch_align_stack(stack_top); 595 stack_top = arch_align_stack(stack_top);
596 stack_top = PAGE_ALIGN(stack_top); 596 stack_top = PAGE_ALIGN(stack_top);
597
598 if (unlikely(stack_top < mmap_min_addr) ||
599 unlikely(vma->vm_end - vma->vm_start >= stack_top - mmap_min_addr))
600 return -ENOMEM;
601
597 stack_shift = vma->vm_end - stack_top; 602 stack_shift = vma->vm_end - stack_top;
598 603
599 bprm->p -= stack_shift; 604 bprm->p -= stack_shift;