diff --git a/fs/exec.c b/fs/exec.c index 802bc1ed7..820d5e394 100755 --- a/fs/exec.c +++ b/fs/exec.c @@ -769,7 +769,8 @@ int setup_arg_pages(struct linux_binprm *bprm, stack_base = STACK_SIZE_MAX; /* Add space for stack randomization. */ - stack_base += (STACK_RND_MASK << PAGE_SHIFT); + if (current->flags & PF_RANDOMIZE) + 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)