Skip to content

Commit 21c1176

Browse files
author
Al Viro
committed
arm: if we get into work_pending while returning to kernel mode, just go away
checking in do_signal() is pointless - if we get there with !user_mode(regs) (and we might), we'll end up looping indefinitely. Check in work_pending and break out of the loop if so. Acked-by: Russell King <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent d9be5ea commit 21c1176

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

arch/arm/kernel/entry-common.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ work_pending:
5656
/*
5757
* TIF_SIGPENDING or TIF_NOTIFY_RESUME must've been set if we got here
5858
*/
59+
ldr r2, [sp, #S_PSR]
5960
mov r0, sp @ 'regs'
61+
tst r2, #15 @ are we returning to user mode?
62+
bne no_work_pending @ no? just leave, then...
6063
mov r2, why @ 'syscall'
6164
tst r1, #_TIF_SIGPENDING @ delivering a signal?
6265
movne why, #0 @ prevent further restarts

arch/arm/kernel/signal.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
608608
siginfo_t info;
609609
int signr;
610610

611-
/*
612-
* We want the common case to go fast, which
613-
* is why we may in certain cases get here from
614-
* kernel mode. Just return without doing anything
615-
* if so.
616-
*/
617-
if (!user_mode(regs))
618-
return;
619-
620611
/*
621612
* If we were from a system call, check for system call restarting...
622613
*/

0 commit comments

Comments
 (0)