aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-02 21:45:12 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-01 09:58:10 -0400
commitbfc83647bbbb2aaf748a582ed7d45fb1408d4671 (patch)
treeb4685834725a134f0826d7ec6f3234e7964b4aaa /arch/mips
parentcf880248c56495a5e616cde226d7c85972a3218c (diff)
mips: prevent hitting do_notify_resume() with !user_mode(regs)
too late to do anything there... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/entry.S3
-rw-r--r--arch/mips/kernel/signal.c8
2 files changed, 3 insertions, 8 deletions
diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
index 37acfa036d44..4b0937f19862 100644
--- a/arch/mips/kernel/entry.S
+++ b/arch/mips/kernel/entry.S
@@ -167,6 +167,9 @@ work_notifysig: # deal with pending signals and
167FEXPORT(syscall_exit_work_partial) 167FEXPORT(syscall_exit_work_partial)
168 SAVE_STATIC 168 SAVE_STATIC
169syscall_exit_work: 169syscall_exit_work:
170 LONG_L t0, PT_STATUS(sp) # returning to kernel mode?
171 andi t0, t0, KU_USER
172 beqz t0, resume_kernel
170 li t0, _TIF_WORK_SYSCALL_EXIT 173 li t0, _TIF_WORK_SYSCALL_EXIT
171 and t0, a2 # a2 is preloaded with TI_FLAGS 174 and t0, a2 # a2 is preloaded with TI_FLAGS
172 beqz t0, work_pending # trace bit set? 175 beqz t0, work_pending # trace bit set?
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index f2c09cfc60ac..0e1a5b8ae817 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -560,14 +560,6 @@ static void do_signal(struct pt_regs *regs)
560 siginfo_t info; 560 siginfo_t info;
561 int signr; 561 int signr;
562 562
563 /*
564 * We want the common case to go fast, which is why we may in certain
565 * cases get here from kernel mode. Just return without doing anything
566 * if so.
567 */
568 if (!user_mode(regs))
569 return;
570
571 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 563 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
572 if (signr > 0) { 564 if (signr > 0) {
573 /* Whee! Actually deliver the signal. */ 565 /* Whee! Actually deliver the signal. */