Skip to content

Commit

Permalink
mips: prevent hitting do_notify_resume() with !user_mode(regs)
Browse files Browse the repository at this point in the history
too late to do anything there...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 1, 2012
1 parent cf88024 commit bfc8364
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 3 additions & 0 deletions arch/mips/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
8 changes: 0 additions & 8 deletions arch/mips/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit bfc8364

Please sign in to comment.