aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2013-11-07 11:08:36 -0500
committerHelge Deller <deller@gmx.de>2013-11-07 16:29:24 -0500
commit1f2048fd8bc4219db821611da305a74f4b72b3c3 (patch)
treebe8e53b15accf5a770482f1e33ea4a0904fa25f7
parent63379c135331c724d40a87b98eb62d2122981341 (diff)
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: Helge Deller <deller@gmx.de>
-rw-r--r--arch/parisc/mm/fault.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index df0d32971cdf..7584a5df0fa4 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -280,12 +280,22 @@ bad_area:
280 } 280 }
281 show_regs(regs); 281 show_regs(regs);
282#endif 282#endif
283 /* FIXME: actually we need to get the signo and code correct */ 283 switch (code) {
284 si.si_signo = SIGSEGV; 284 case 15: /* Data TLB miss fault/Data page fault */
285 case 17: /* NA data TLB miss / page fault */
286 case 18: /* Unaligned access - PCXS only */
287 si.si_signo = SIGBUS;
288 si.si_code = BUS_ADRERR;
289 break;
290 case 16: /* Non-access instruction TLB miss fault */
291 case 26: /* PCXL: Data memory access rights trap */
292 default:
293 si.si_signo = SIGSEGV;
294 si.si_code = SEGV_MAPERR;
295 }
285 si.si_errno = 0; 296 si.si_errno = 0;
286 si.si_code = SEGV_MAPERR;
287 si.si_addr = (void __user *) address; 297 si.si_addr = (void __user *) address;
288 force_sig_info(SIGSEGV, &si, current); 298 force_sig_info(si.si_signo, &si, current);
289 return; 299 return;
290 } 300 }
291 301