mips: prevent hitting do_notify_resume() with !user_mode(regs)
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 May 2012 01:45:12 +0000 (21:45 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 1 Oct 2012 13:58:10 +0000 (09:58 -0400)
too late to do anything there...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/mips/kernel/entry.S
arch/mips/kernel/signal.c

index 37acfa036d441421dfe979aebdb0ba2a37655d92..4b0937f198620d0ceb195de55ea4d4b967268d70 100644 (file)
@@ -167,6 +167,9 @@ work_notifysig:                             # deal with pending signals and
 FEXPORT(syscall_exit_work_partial)
        SAVE_STATIC
 syscall_exit_work:
+       LONG_L  t0, PT_STATUS(sp)               # returning to kernel mode?
+       andi    t0, t0, KU_USER
+       beqz    t0, resume_kernel
        li      t0, _TIF_WORK_SYSCALL_EXIT
        and     t0, a2                  # a2 is preloaded with TI_FLAGS
        beqz    t0, work_pending        # trace bit set?
index f2c09cfc60ac338dc9300f3487bae83e48a8cbd1..0e1a5b8ae817c4c69f417f3aff2d9aade7a5cad0 100644 (file)
@@ -560,14 +560,6 @@ static void do_signal(struct pt_regs *regs)
        siginfo_t info;
        int signr;
 
-       /*
-        * We want the common case to go fast, which is why we may in certain
-        * cases get here from kernel mode. Just return without doing anything
-        * if so.
-        */
-       if (!user_mode(regs))
-               return;
-
        signr = get_signal_to_deliver(&info, &ka, regs, NULL);
        if (signr > 0) {
                /* Whee!  Actually deliver the signal.  */