[PATCH] ppc64: Fix v_regs pointer setup

From: Srivatsa Vaddagiri
Date: Wed Aug 18 2004 - 10:12:25 EST


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@xxxxxxxxxx>

---

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