[PATCH] FRV: Fix sigaltstack handling for RT signals

From: David Howells
Date: Fri Feb 11 2005 - 09:46:55 EST



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: David Howells <dhowells@xxxxxxxxxx>
Signed-Off-By: Alexander Viro <aviro@xxxxxxxxxx>
---
warthog>diffstat frv-sigaltstk-2611rc3.diff
signal.c | 11 +----------
1 files changed, 1 insertion(+), 10 deletions(-)

diff -uNrp /warthog/kernels/linux-2.6.11-rc3/arch/frv/kernel/signal.c linux-2.6.11-rc3-frv/arch/frv/kernel/signal.c
--- /warthog/kernels/linux-2.6.11-rc3/arch/frv/kernel/signal.c 2005-02-04 11:49:30.000000000 +0000
+++ linux-2.6.11-rc3-frv/arch/frv/kernel/signal.c 2005-02-11 12:46:40.369651032 +0000
@@ -242,18 +242,9 @@ asmlinkage int sys_rt_sigreturn(void)
if (restore_sigcontext(&frame->uc.uc_mcontext, &gr8))
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;

- /* 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;

badframe:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/