Patchwork [3/6] mips: null pointer deref should segfault

login
register
mail settings
Submitter Wesley W. Terpstra
Date July 8, 2011, 12:59 p.m.
Message ID <CAA-O0Xixn42CumVDF=QzW7Bu2+yLgzU-cZRusLJGf06BWyu5dw@mail.gmail.com>
Download mbox | patch
Permalink /patch/103840/
State New
Headers show

Comments

Wesley W. Terpstra - July 8, 2011, 12:59 p.m.
Dereferencing a null pointer causes an exception 0xC (EXCP_AdEL)
instead of EXCP_TLBL. This should also trigger a segfault.

Signed-off-by: Wesley W. Terpstra <terpstra@debian.org>
---

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 289054b..26ebc73 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2093,6 +2107,8 @@  void cpu_loop(CPUMIPSState *env)
             break;
         case EXCP_TLBL:
         case EXCP_TLBS:
+        case EXCP_AdEL:
+        case EXCP_AdES:
             info.si_signo = TARGET_SIGSEGV;
             info.si_errno = 0;
             /* XXX: check env->error_code */