summaryrefslogtreecommitdiffstats
path: root/arch/openrisc/kernel/signal.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-09-20 21:49:09 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-29 03:46:11 +0100
commitd26654e5f9cd27815ab5bc8148c826f3b960396c (patch)
tree1b3ec491b709e3ed9f1b2d80e7bc4f1debe24b4c /arch/openrisc/kernel/signal.c
parentum: get_safe_registers() should be done in flush_thread(), not start_thread() (diff)
downloadlinux-d26654e5f9cd27815ab5bc8148c826f3b960396c.tar.xz
linux-d26654e5f9cd27815ab5bc8148c826f3b960396c.zip
openrisk: fix altstack switching on sigreturn
do_sigaltstack() expects _userland_ address, TYVM... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--arch/openrisc/kernel/signal.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c
index 30110297f4f9..ddedc8a77861 100644
--- a/arch/openrisc/kernel/signal.c
+++ b/arch/openrisc/kernel/signal.c
@@ -84,7 +84,6 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
{
struct rt_sigframe *frame = (struct rt_sigframe __user *)regs->sp;
sigset_t set;
- stack_t st;
/*
* Since we stacked the signal on a dword boundary,
@@ -104,11 +103,10 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe;
- if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st)))
- goto badframe;
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
- do_sigaltstack(&st, NULL, regs->sp);
+ if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->sp) == -EFAULT)
+ goto badframe;
return regs->gpr[11];