Commit 923bf111 authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Linus Torvalds

[PATCH] 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.
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@in.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0cc8f1e0
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment