All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FRV: Fix sigaltstack handling for RT signals
@ 2005-02-11 14:45 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2005-02-11 14:45 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel


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@redhat.com>
Signed-Off-By: Alexander Viro <aviro@redhat.com>
---
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:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-11 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-11 14:45 [PATCH] FRV: Fix sigaltstack handling for RT signals David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.