android_kernel_samsung_msm8976/include
Linus Torvalds 88b5d12c64 mm: propagate error from stack expansion even for guard page
commit fee7e49d45149fba60156f5b59014f764d3e3728 upstream.

Jay Foad reports that the address sanitizer test (asan) sometimes gets
confused by a stack pointer that ends up being outside the stack vma
that is reported by /proc/maps.

This happens due to an interaction between RLIMIT_STACK and the guard
page: when we do the guard page check, we ignore the potential error
from the stack expansion, which effectively results in a missing guard
page, since the expected stack expansion won't have been done.

And since /proc/maps explicitly ignores the guard page (commit
d7824370e263: "mm: fix up some user-visible effects of the stack guard
page"), the stack pointer ends up being outside the reported stack area.

This is the minimal patch: it just propagates the error.  It also
effectively makes the guard page part of the stack limit, which in turn
measn that the actual real stack is one page less than the stack limit.

Let's see if anybody notices.  We could teach acct_stack_growth() to
allow an extra page for a grow-up/grow-down stack in the rlimit test,
but I don't want to add more complexity if it isn't needed.

Reported-and-tested-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-16 06:59:03 -08:00
..
acpi
asm-generic mm: use paravirt friendly ops for NUMA hinting ptes 2014-05-30 21:52:12 -07:00
clocksource clocksource: arch_timer: use virtual counters 2014-01-09 12:24:26 -08:00
crypto crypto: scatterwalk - Use sg_chain_ptr on chain entries 2013-12-11 22:36:29 -08:00
drm drm/radeon: remove invalid pci id 2014-11-14 08:48:00 -08:00
dt-bindings
keys
linux mm: propagate error from stack expansion even for guard page 2015-01-16 06:59:03 -08:00
math-emu
media media: vb2: fix VBI/poll regression 2014-10-09 12:18:42 -07:00
memory
misc
net net: sctp: fix skb_over_panic when receiving malformed ASCONF chunks 2014-11-21 09:22:55 -08:00
pcmcia
ras
rdma
rxrpc
scsi scsi: fix our current target reap infrastructure 2014-05-30 21:52:11 -07:00
sound ALSA: control: Protect user controls against concurrent access 2014-06-26 15:12:43 -04:00
target target: Report correct response length for some commands 2014-06-30 20:09:45 -07:00
trace tracing: Fix syscall_*regfunc() vs copy_process() race 2014-07-06 18:54:16 -07:00
uapi netfilter: xt_bpf: add mising opaque struct sk_filter definition 2014-11-21 09:22:54 -08:00
video
xen
Kbuild