Merge branch 'parisc-5.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[linux-2.6-microblaze.git] / fs / exec.c
index c238c25..5d4d520 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -757,8 +757,8 @@ int setup_arg_pages(struct linux_binprm *bprm,
 #ifdef CONFIG_STACK_GROWSUP
        /* Limit stack size */
        stack_base = bprm->rlim_stack.rlim_max;
-       if (stack_base > STACK_SIZE_MAX)
-               stack_base = STACK_SIZE_MAX;
+
+       stack_base = calc_max_stack_size(stack_base);
 
        /* Add space for stack randomization. */
        stack_base += (STACK_RND_MASK << PAGE_SHIFT);