Skip to contentSkip to conversation

FRV: Fix sigaltstack handling for RT signals

PATCH New David Howells 1 participant 1 message Feb 11, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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...

---
warthog>diffstat frv-sigaltstk-2611rc3.diff

 signal.c |   11 +----------
 1 files changed, 1 insertion(+), 10 deletions(-)
arch/frv/kernel/signal.c renamed from warthog/kernels/linux-2.6.11-rc3/arch/frv/kernel/signal.c +1 -10
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
@@ -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: