Commit 96b39b5b authored by David Howells's avatar David Howells Committed by Linus Torvalds

[PATCH] FRV: Fix sigaltstack handling for RT signals

The attached patch fixes sigaltstack handling for RT signal return. It was
reading a userspace struct into kernel space and then passing the kernel copy
to a generic signalling routine which then assumed it had been passed a
userspace pointer...
Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
Signed-Off-By: default avatarAlexander Viro <aviro@redhat.com>
Signed-Off-By: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8b1ef6f5
...@@ -242,18 +242,9 @@ asmlinkage int sys_rt_sigreturn(void) ...@@ -242,18 +242,9 @@ asmlinkage int sys_rt_sigreturn(void)
if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8)) if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8))
goto badframe; goto badframe;
if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) if (do_sigaltstack(&frame->uc.uc_stack, NULL, __frame->sp) == -EFAULT)
goto badframe; goto badframe;
/* It is more difficult to avoid calling this function than to
* call it and ignore errors. */
/*
* THIS CANNOT WORK! "&st" is a kernel address, and "do_sigaltstack()"
* takes a user address (and verifies that it is a user address). End
* result: it does exactly _nothing_.
*/
do_sigaltstack(&st, NULL, __frame->sp);
return gr8; return gr8;
badframe: badframe:
......
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