summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-09-21 00:38:34 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-29 06:46:11 +0400
commit9dc87c7b5b0a2db407e086f45cf08ca78208cc16 (patch)
treeae445ffb58167e7d83d79c17107dfaa98040fead /arch/sh
parentd26654e5f9cd27815ab5bc8148c826f3b960396c (diff)
downloadlinux-9dc87c7b5b0a2db407e086f45cf08ca78208cc16.tar.xz
sh64: fix altstack switching on sigreturn
incidentally, declaring a local variable as __user (!) to make sparse STFU is really sick. Especially since sparse had been 100% right - it *is* a bug. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/signal_64.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index 23853814bd17..d867cd95a622 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -347,7 +347,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
{
struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (long) REF_REG_SP;
sigset_t set;
- stack_t __user st;
long long ret;
/* Always make any pending restarted system calls return -EINTR */
@@ -365,11 +364,10 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
goto badframe;
regs->pc -= 4;
- 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, REF_REG_SP);
+ if (do_sigaltstack(&frame->uc.uc_stack, NULL, REF_REG_SP) == -EFAULT)
+ goto badframe;
return (int) ret;