public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] fix for siginfo.si_addr on NaT page triggered SIGSEGV
@ 2003-03-06 21:26 David Mosberger
  0 siblings, 0 replies; only message in thread
From: David Mosberger @ 2003-03-06 21:26 UTC (permalink / raw)
  To: linux-ia64

The patch below fixes a bug which caused si_addr to be set to the
faulting IP instead of the faulting data address when a SIGSEGV got
triggered by the NaT page.  The patch is relative to 2.5, but I
believe it applies on 2.4 as well.

	--david

=== arch/ia64/kernel/traps.c 1.25 vs edited ==--- 1.25/arch/ia64/kernel/traps.c	Tue Feb  4 17:06:16 2003
+++ edited/arch/ia64/kernel/traps.c	Thu Mar  6 11:44:58 2003
@@ -486,19 +486,23 @@
 
 	      case 26: /* NaT Consumption */
 		if (user_mode(regs)) {
+			void *addr;
+
 			if (((isr >> 4) & 0xf) = 2) {
 				/* NaT page consumption */
 				sig = SIGSEGV;
 				code = SEGV_ACCERR;
+				addr = (void *) ifa;
 			} else {
 				/* register NaT consumption */
 				sig = SIGILL;
 				code = ILL_ILLOPN;
+				addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
 			}
 			siginfo.si_signo = sig;
 			siginfo.si_code = code;
 			siginfo.si_errno = 0;
-			siginfo.si_addr = (void *) (regs->cr_iip + ia64_psr(regs)->ri);
+			siginfo.si_addr = addr;
 			siginfo.si_imm = vector;
 			siginfo.si_flags = __ISR_VALID;
 			siginfo.si_isr = isr;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-06 21:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-06 21:26 [Linux-ia64] fix for siginfo.si_addr on NaT page triggered SIGSEGV David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox