ARM: only print segfault if it's unhandled
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 23 Oct 2016 19:11:50 +0000 (22:11 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 23 Oct 2016 19:11:50 +0000 (22:11 +0300)
and rate-limit it too, all like x86 does

arch/arm/mm/fault.c

index ea34eb9..be74cf8 100644 (file)
@@ -197,7 +197,8 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
        struct siginfo si;
 
 #ifdef CONFIG_DEBUG_USER
-       if (user_debug & (UDBG_SEGV | UDBG_SEGV_SHORT)) {
+       if ((user_debug & (UDBG_SEGV | UDBG_SEGV_SHORT))
+           && unhandled_signal(tsk, SIGSEGV) && printk_ratelimit()) {
                printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x (%s)\n",
                       tsk->comm, sig, addr, fsr,
                       (fsr & FSR_WRITE) ? "write" : "read");