Re: 2.6.8.1-mm2

From: Paul Mackerras
Date: Fri Aug 20 2004 - 01:59:56 EST


Srivatsa Vaddagiri writes:

> Paul rightly pointed out that is should be +15 and not +16. My mistake.
> Updated ppc64-fix-v_regs-pointer-setup.patch below:

That patch applies on top of the previous one from Srivatsa. Here is
a single patch that has the change we want against Linus' tree.

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@xxxxxxxxxx>
Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>

diff -urN linux-2.5/arch/ppc64/kernel/signal.c akpm/arch/ppc64/kernel/signal.c
--- linux-2.5/arch/ppc64/kernel/signal.c 2004-06-18 19:06:50.000000000 +1000
+++ akpm/arch/ppc64/kernel/signal.c 2004-08-20 16:56:55.040912736 +1000
@@ -127,7 +127,7 @@
* 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;

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