Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Commit 3bc7424

Browse files
hdellergregkh
authored andcommitted
parisc: Report SIGSEGV instead of SIGBUS when running out of stack
commit 2474623 upstream. When a process runs out of stack the parisc kernel wrongly faults with SIGBUS instead of the expected SIGSEGV signal. This example shows how the kernel faults: do_page_fault() command='a.out' type=15 address=0xfaac2000 in libc-2.24.so[f830800+16c000] trap #15: Data TLB miss fault, vm_start = 0xfa2c2000, vm_end = 0xfaac2000 The vma->vm_end value is the first address which does not belong to the vma, so adjust the check to include vma->vm_end to the range for which to send the SIGSEGV signal. This patch unbreaks building the debian libsigsegv package. Signed-off-by: Helge Deller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5b2c6af commit 3bc7424

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/parisc/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
367367
case 15: /* Data TLB miss fault/Data page fault */
368368
/* send SIGSEGV when outside of vma */
369369
if (!vma ||
370-
address < vma->vm_start || address > vma->vm_end) {
370+
address < vma->vm_start || address >= vma->vm_end) {
371371
si.si_signo = SIGSEGV;
372372
si.si_code = SEGV_MAPERR;
373373
break;

0 commit comments

Comments
 (0)