diff options
author | David S. Miller <davem@davemloft.net> | 2010-09-22 07:30:13 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-22 07:30:13 +0200 |
commit | c27852597829128a9c9d96d79ec454a83c6b0da5 (patch) | |
tree | 3fe8d2b5cd9d59a47c64491ba2398bc2039d339c /arch/sparc/kernel/signal32.c | |
parent | sparc: Don't mask signal when we can't setup signal frame. (diff) | |
download | linux-c27852597829128a9c9d96d79ec454a83c6b0da5.tar.xz linux-c27852597829128a9c9d96d79ec454a83c6b0da5.zip |
sparc: Prevent no-handler signal syscall restart recursion.
Explicitly clear the "in-syscall" bit when we have no signal
handler and back up the program counters to back up the system
call.
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/signal32.c')
-rw-r--r-- | arch/sparc/kernel/signal32.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index 643a354795cc..75fad425e249 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c @@ -616,7 +616,7 @@ static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, flush_signal_insns(address); } - return; + return 0; sigill: do_exit(SIGILL); @@ -840,12 +840,14 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, regs->u_regs[UREG_I0] = orig_i0; regs->tpc -= 4; regs->tnpc -= 4; + pt_regs_clear_syscall(regs); } if (restart_syscall && regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { regs->u_regs[UREG_G1] = __NR_restart_syscall; regs->tpc -= 4; regs->tnpc -= 4; + pt_regs_clear_syscall(regs); } /* If there's no signal to deliver, we just put the saved sigmask |