Commit 1f2048fd authored by Helge Deller's avatar Helge Deller

parisc: signal fixup - SIGBUS vs. SIGSEGV

Clean up code to send correct signal on invalid memory accesses:
Send SIGBUS instead of SIGSEGV for memory accesses outside of mmap'ed
areas

This fixes the mmap13 testcase from the Linux Test Project.
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 63379c13
...@@ -280,12 +280,22 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, ...@@ -280,12 +280,22 @@ void do_page_fault(struct pt_regs *regs, unsigned long code,
} }
show_regs(regs); show_regs(regs);
#endif #endif
/* FIXME: actually we need to get the signo and code correct */ switch (code) {
si.si_signo = SIGSEGV; case 15: /* Data TLB miss fault/Data page fault */
case 17: /* NA data TLB miss / page fault */
case 18: /* Unaligned access - PCXS only */
si.si_signo = SIGBUS;
si.si_code = BUS_ADRERR;
break;
case 16: /* Non-access instruction TLB miss fault */
case 26: /* PCXL: Data memory access rights trap */
default:
si.si_signo = SIGSEGV;
si.si_code = SEGV_MAPERR;
}
si.si_errno = 0; si.si_errno = 0;
si.si_code = SEGV_MAPERR;
si.si_addr = (void __user *) address; si.si_addr = (void __user *) address;
force_sig_info(SIGSEGV, &si, current); force_sig_info(si.si_signo, &si, current);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment