aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-01-29 14:15:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-29 14:15:17 -0500
commit9c145c56d0c8a0b62e48c8d71e055ad0fb2012ba (patch)
treeff181616c8f82e8ff3a800bb3cd2a586b8fef4e8 /mm/memory.c
parent33692f27597fcab536d7cbbcc8f52905133e4aa7 (diff)
vm: make stack guard page errors return VM_FAULT_SIGSEGV rather than SIGBUS
The stack guard page error case has long incorrectly caused a SIGBUS rather than a SIGSEGV, but nobody actually noticed until commit fee7e49d4514 ("mm: propagate error from stack expansion even for guard page") because that error case was never actually triggered in any normal situations. Now that we actually report the error, people noticed the wrong signal that resulted. So far, only the test suite of libsigsegv seems to have actually cared, but there are real applications that use libsigsegv, so let's not wait for any of those to break. Reported-and-tested-by: Takashi Iwai <tiwai@suse.de> Tested-by: Jan Engelhardt <jengelh@inai.de> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> # "s390 still compiles and boots" Cc: linux-arch@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 54f3a9b00956..2c3536cc6c63 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2632,7 +2632,7 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
2632 2632
2633 /* Check if we need to add a guard page to the stack */ 2633 /* Check if we need to add a guard page to the stack */
2634 if (check_stack_guard_page(vma, address) < 0) 2634 if (check_stack_guard_page(vma, address) < 0)
2635 return VM_FAULT_SIGBUS; 2635 return VM_FAULT_SIGSEGV;
2636 2636
2637 /* Use the zero-page for reads */ 2637 /* Use the zero-page for reads */
2638 if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm)) { 2638 if (!(flags & FAULT_FLAG_WRITE) && !mm_forbids_zeropage(mm)) {