Commit d26654e5 authored by Al Viro's avatar Al Viro

openrisk: fix altstack switching on sigreturn

do_sigaltstack() expects _userland_ address, TYVM...
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 9436d5c3
...@@ -84,7 +84,6 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) ...@@ -84,7 +84,6 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
{ {
struct rt_sigframe *frame = (struct rt_sigframe __user *)regs->sp; struct rt_sigframe *frame = (struct rt_sigframe __user *)regs->sp;
sigset_t set; sigset_t set;
stack_t st;
/* /*
* Since we stacked the signal on a dword boundary, * Since we stacked the signal on a dword boundary,
...@@ -104,11 +103,10 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs) ...@@ -104,11 +103,10 @@ asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe; 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 /* It is more difficult to avoid calling this function than to
call it and ignore errors. */ 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]; return regs->gpr[11];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment