arm64: Do not report user faults for handled signals
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 21 May 2013 11:16:56 +0000 (12:16 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 24 May 2013 16:31:04 +0000 (17:31 +0100)
Currently user faults (page, undefined instruction) are always reported
even though the user may have a signal handler for them. This patch adds
unhandled_signal() check together with printk_ratelimit() for these
cases.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/traps.c
arch/arm64/mm/fault.c

index 61d7dd29f756c300926410cef60ab523a5a7a7b1..f1ff9bad00f79a2531d7663f378f52a2c1686f6f 100644 (file)
@@ -267,7 +267,8 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
                return;
 #endif
 
-       if (show_unhandled_signals) {
+       if (show_unhandled_signals && unhandled_signal(current, SIGILL) &&
+           printk_ratelimit()) {
                pr_info("%s[%d]: undefined instruction: pc=%p\n",
                        current->comm, task_pid_nr(current), pc);
                dump_instr(KERN_INFO, regs);
@@ -294,7 +295,7 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs)
        }
 #endif
 
-       if (show_unhandled_signals) {
+       if (show_unhandled_signals && printk_ratelimit()) {
                pr_info("%s[%d]: syscall %d\n", current->comm,
                        task_pid_nr(current), (int)regs->syscallno);
                dump_instr("", regs);
index 98af6e760cce6781a5b117d786bcd16fc136a0b1..1426468b77f3bb7b6df96d604851449db13ed0da 100644 (file)
@@ -113,7 +113,8 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr,
 {
        struct siginfo si;
 
-       if (show_unhandled_signals) {
+       if (show_unhandled_signals && unhandled_signal(tsk, sig) &&
+           printk_ratelimit()) {
                pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n",
                        tsk->comm, task_pid_nr(tsk), fault_name(esr), sig,
                        addr, esr);