]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: Fix v_regs pointer setup
authorSrivatsa Vaddagiri <vatsa@in.ibm.com>
Mon, 23 Aug 2004 05:33:05 +0000 (22:33 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 05:33:05 +0000 (22:33 -0700)
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.

Signed-off-by: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc64/kernel/signal.c

index 8323d7355f5953821174155ce378bdc0a7088c46..ac686cac70c766d3f5d1a672db127bc509229424 100644 (file)
@@ -127,7 +127,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
         * 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 + 15) & ~0xful);
 #endif
        long err = 0;