ppc64: Fix v_regs pointer setup
PATCH 1/1 ppc64: Fix v_regs pointer setup
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 <[email protected]>
---
linux-2.6.8.1-vatsa/arch/ppc64/kernel/signal.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
arch/ppc64/kernel/signal.c renamed from arch/ppc64/kernel/signal.c~signal_fix +1 -1
@@ -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 ;
_
Signature · 5 lines
Thanks and Regards, Srivatsa Vaddagiri, Linux Technology Center, IBM Software Labs, Bangalore, INDIA - 560017