]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Don't count the stack guard page towards RLIMIT_STACK
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Jan 2015 19:33:57 +0000 (11:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 11 Jan 2015 19:33:57 +0000 (11:33 -0800)
commita49fa6e6d878f052df40d6b3decd1a4b0e47af6d
tree72d9df754ed4291de6287c30502dd66a04aa6845
parentb4569f6c6c11c1b8748a55e222ac678e15804f3e
mm: Don't count the stack guard page towards RLIMIT_STACK

Commit c84dee83c742 ("mm: propagate error from stack expansion even for
guard page") made sure that we return the error properly for stack
growth conditions.  It also theorized that counting the guard page
towards the stack limit might break something, but also said "Let's see
if anybody notices".

Somebody did notice.  Apparently android-x86 sets the stack limit very
close to the limit indeed, and including the guard page in the rlimit
check causes the android 'zygote' process problems.

So this adds the (fairly trivial) code to make the stack rlimit check be
against the actual real stack size, rather than the size of the vma that
includes the guard page.

Reported-and-tested-by: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Jay Foad <jay.foad@gmail.com>
Cc: stable@kernel.org # to match back-porting of c84dee83c742
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c