diff options
author | David S. Miller <davem@davemloft.net> | 2010-09-22 01:30:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-22 01:30:13 -0400 |
commit | c27852597829128a9c9d96d79ec454a83c6b0da5 (patch) | |
tree | 3fe8d2b5cd9d59a47c64491ba2398bc2039d339c /arch/sparc/kernel/signal32.c | |
parent | 392c21802ee3aa85cee0e703105f797a8a7b9416 (diff) |
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, | |||
616 | 616 | ||
617 | flush_signal_insns(address); | 617 | flush_signal_insns(address); |
618 | } | 618 | } |
619 | return; | 619 | return 0; |
620 | 620 | ||
621 | sigill: | 621 | sigill: |
622 | do_exit(SIGILL); | 622 | do_exit(SIGILL); |
@@ -840,12 +840,14 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
840 | regs->u_regs[UREG_I0] = orig_i0; | 840 | regs->u_regs[UREG_I0] = orig_i0; |
841 | regs->tpc -= 4; | 841 | regs->tpc -= 4; |
842 | regs->tnpc -= 4; | 842 | regs->tnpc -= 4; |
843 | pt_regs_clear_syscall(regs); | ||
843 | } | 844 | } |
844 | if (restart_syscall && | 845 | if (restart_syscall && |
845 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { | 846 | regs->u_regs[UREG_I0] == ERESTART_RESTARTBLOCK) { |
846 | regs->u_regs[UREG_G1] = __NR_restart_syscall; | 847 | regs->u_regs[UREG_G1] = __NR_restart_syscall; |
847 | regs->tpc -= 4; | 848 | regs->tpc -= 4; |
848 | regs->tnpc -= 4; | 849 | regs->tnpc -= 4; |
850 | pt_regs_clear_syscall(regs); | ||
849 | } | 851 | } |
850 | 852 | ||
851 | /* If there's no signal to deliver, we just put the saved sigmask | 853 | /* If there's no signal to deliver, we just put the saved sigmask |