Skip to content

Commit

Permalink
fs/exec.c: fix initial stack reservation
Browse files Browse the repository at this point in the history
803bf5e ("fs/exec.c: restrict initial
stack space expansion to rlimit") attempts to limit the initial stack to
20*PAGE_SIZE.  Unfortunately, in attempting ensure the stack is not
reduced in size, we ended up not changing the stack at all.

This size reduction check is not necessary as the expand_stack call does
this already.

This caused a regression in UML resulting in most guest processes being
killed.

Signed-off-by: Michael Neuling <[email protected]>
Reviewed-by: KOSAKI Motohiro <[email protected]>
Acked-by: WANG Cong <[email protected]>
Cc: Anton Blanchard <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: James Morris <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Jouni Malinen <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mikey authored and torvalds committed Feb 23, 2010
1 parent 89f3f21 commit a17e187
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
* will align it up.
*/
rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK;
rlim_stack = min(rlim_stack, stack_size);
#ifdef CONFIG_STACK_GROWSUP
if (stack_size + stack_expand > rlim_stack)
stack_base = vma->vm_start + rlim_stack;
Expand Down

0 comments on commit a17e187

Please sign in to comment.