|
@@ -657,10 +657,10 @@ int setup_arg_pages(struct linux_binprm *bprm,
|
|
unsigned long rlim_stack;
|
|
unsigned long rlim_stack;
|
|
|
|
|
|
#ifdef CONFIG_STACK_GROWSUP
|
|
#ifdef CONFIG_STACK_GROWSUP
|
|
- /* Limit stack size to 1GB */
|
|
|
|
|
|
+ /* Limit stack size */
|
|
stack_base = rlimit_max(RLIMIT_STACK);
|
|
stack_base = rlimit_max(RLIMIT_STACK);
|
|
- if (stack_base > (1 << 30))
|
|
|
|
- stack_base = 1 << 30;
|
|
|
|
|
|
+ if (stack_base > STACK_SIZE_MAX)
|
|
|
|
+ stack_base = STACK_SIZE_MAX;
|
|
|
|
|
|
/* Make sure we didn't let the argument array grow too large. */
|
|
/* Make sure we didn't let the argument array grow too large. */
|
|
if (vma->vm_end - vma->vm_start > stack_base)
|
|
if (vma->vm_end - vma->vm_start > stack_base)
|