Commit 53949f83 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] 1GB stack size limit on PA-RISC

This patch introduces a 1GB stack size limit for stack-grows-up (ie
PA-RISC), as discussed previously.
parent b9f07991
......@@ -374,7 +374,13 @@ int setup_arg_pages(struct linux_binprm *bprm)
/* Adjust bprm->p to point to the end of the strings. */
bprm->p = PAGE_SIZE * i - offset;
stack_base = STACK_TOP - current->rlim[RLIMIT_STACK].rlim_max;
/* Limit stack size to 1GB */
stack_base = current->rlim[RLIMIT_STACK].rlim_max;
if (stack_base > (1 << 30))
stack_base = 1 << 30;
stack_base = PAGE_ALIGN(STACK_TOP - stack_base);
mm->arg_start = stack_base;
arg_size = i << PAGE_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment