mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ppc64: Fix v_regs pointer setup
@ 2004-08-18 15:12 Srivatsa Vaddagiri
  0 siblings, 0 replies; only message in thread
From: Srivatsa Vaddagiri @ 2004-08-18 15:12 UTC (permalink / raw)
  To: paulus; +Cc: Andrew Morton, linux-kernel

During some signal test, we found that v_regs pointer was not setup correctly.
v_regs was made to point to itself, as a result of which the pointer was
corrupted when vec registers were copied over. When the signal handler
returned, restore_sigcontext tried derefering the invalid pointer and in
the process killed the app with SIGSEGV.

Following patch should fix it. Please review and apply:


Signed-off-by: Srivatsa Vaddagiri <vatsa@in.ibm.com>

---

 linux-2.6.8.1-vatsa/arch/ppc64/kernel/signal.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/ppc64/kernel/signal.c~signal_fix arch/ppc64/kernel/signal.c
--- linux-2.6.8.1/arch/ppc64/kernel/signal.c~signal_fix	2004-08-18 20:30:23.000000000 +0530
+++ linux-2.6.8.1-vatsa/arch/ppc64/kernel/signal.c	2004-08-18 20:31:35.000000000 +0530
@@ -127,7 +127,7 @@ static long setup_sigcontext(struct sigc
 	 * v_regs pointer or not
 	 */
 #ifdef CONFIG_ALTIVEC
-	elf_vrreg_t __user *v_regs = (elf_vrreg_t __user *)(((unsigned long)sc->vmx_reserve) & ~0xful);
+	elf_vrreg_t __user *v_regs = (elf_vrreg_t __user *)(((unsigned long)sc->vmx_reserve + 16) & ~0xful);
 #endif
 	long err = 0;
 

_

-- 


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017

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

only message in thread, other threads:[~2004-08-18 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-18 15:12 [PATCH] ppc64: Fix v_regs pointer setup Srivatsa Vaddagiri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®