summaryrefslogtreecommitdiff
path: root/arch/sparc/kernel/signal_64.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-09-21 22:30:13 -0700
committerDavid S. Miller <davem@davemloft.net>2010-09-21 22:30:13 -0700
commitc27852597829128a9c9d96d79ec454a83c6b0da5 (patch)
tree3fe8d2b5cd9d59a47c64491ba2398bc2039d339c /arch/sparc/kernel/signal_64.c
parent392c21802ee3aa85cee0e703105f797a8a7b9416 (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/signal_64.c')
-rw-r--r--arch/sparc/kernel/signal_64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index 3f19e673e2cd..006fe4515886 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -600,12 +600,14 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
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