sparc64: not any error from do_sigaltstack() should fail rt_sigreturn()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 19 Nov 2012 03:27:03 +0000 (22:27 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Dec 2012 19:47:10 +0000 (11:47 -0800)
commit98165e2b0d355759c16bae8d9ae09b445149cfbd
tree241bf74912b294c2e4d973b153a4705e3557fe61
parentacaf0ed4bdd03d31d0df0bf33816bdaceecbe7cc
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/kernel/signal_64.c