FRV: Prevent syscall exit tracing and notify_resume at end of kernel exceptions
authorDavid Howells <dhowells@redhat.com>
Tue, 1 May 2012 18:44:14 +0000 (19:44 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 1 Jun 2012 16:59:18 +0000 (12:59 -0400)
Move the test for kernel mode processing from do_signal() into entry.S to also
prevent system call exit tracing and userspace resumption notification handling
happening when returning from kernel exceptions.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/frv/kernel/entry.S
arch/frv/kernel/signal.c

index 5ba23f715ea5e7f0f3dfcc0cab6a860519e41ec6..ff3092c18ca2cb813d5da95e7ce195811f0d3037 100644 (file)
@@ -1163,7 +1163,9 @@ __syscall_trace_entry:
        # perform syscall exit tracing
 __syscall_exit_work:
        LEDS            0x6340
-       andicc          gr4,#_TIF_SYSCALL_TRACE,gr0,icc0
+       andicc          gr22,#PSR_PS,gr0,icc1   ; don't handle on return to kernel mode
+       andicc.p        gr4,#_TIF_SYSCALL_TRACE,gr0,icc0
+       bne             icc1,#0,__entry_return_direct
        beq             icc0,#1,__entry_work_pending
 
        movsg           psr,gr23
index 4e134c7eceea30e01267753be60f37ccc8b8093f..f3b9064c548c1e3b3870c5a450b9f333d64ff082 100644 (file)
@@ -474,18 +474,8 @@ static void do_signal(void)
 {
        struct k_sigaction ka;
        siginfo_t info;
-       sigset_t *oldset;
        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(__frame))
-               return;
-
        signr = get_signal_to_deliver(&info, &ka, __frame, NULL);
        if (signr > 0) {
                handle_signal(signr, &info, &ka);