aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-11-18 22:27:03 -0500
committerBen Hutchings <ben@decadent.org.uk>2012-12-06 11:20:26 +0000
commite7ac9b5fc607f246a1ce62e418c0a7e5bb02c012 (patch)
treec77246d23c5926a04a2a830fd50162d3c6d4c218 /arch/sparc
parentad271ac21223b34db8b05091b66f1758c7e5df4a (diff)
downloadkernel_samsung_smdk4412-e7ac9b5fc607f246a1ce62e418c0a7e5bb02c012.zip
kernel_samsung_smdk4412-e7ac9b5fc607f246a1ce62e418c0a7e5bb02c012.tar.gz
kernel_samsung_smdk4412-e7ac9b5fc607f246a1ce62e418c0a7e5bb02c012.tar.bz2
sparc64: not any error from do_sigaltstack() should fail rt_sigreturn()
commit fae2ae2a900a5c7bb385fe4075f343e7e2d5daa2 upstream. If a signal handler is executed on altstack and another signal comes, we will end up with rt_sigreturn() on return from the second handler getting -EPERM from do_sigaltstack(). It's perfectly OK, since we are not asking to change the settings; in fact, they couldn't have been changed during the second handler execution exactly because we'd been on altstack all along. 64bit sigreturn on sparc treats any error from do_sigaltstack() as "SIGSEGV now"; we need to switch to the same semantics we are using on other architectures. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/signal_64.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index f0836cd..d58d3ed 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -307,9 +307,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
err |= restore_fpu_state(regs, fpu_save);
err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t));
- err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf);
-
- if (err)
+ if (err || do_sigaltstack(&sf->stack, NULL, (unsigned long)sf) == -EFAULT)
goto segv;
err |= __get_user(rwin_save, &sf->rwin_save);