s390/simd: clear vector register pointer on fork/clone
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 1 Dec 2014 17:05:35 +0000 (18:05 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 8 Dec 2014 08:42:35 +0000 (09:42 +0100)
The copy_thread function fails to reset the p->thread.vxrs pointer.
This causes the child to use the same vector register save area,
causing both data corruptions and multiple frees of the memory for
the save area after the tasks sharing the save area terminate.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/process.c

index 4192dfd55ddc0e715b4efe02ca82c45d40affa46..aa7a83948c7b13fda4712ec1081808f849ef2b23 100644 (file)
@@ -153,6 +153,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
        save_fp_ctl(&p->thread.fp_regs.fpc);
        save_fp_regs(p->thread.fp_regs.fprs);
        p->thread.fp_regs.pad = 0;
+       p->thread.vxrs = NULL;
        /* Set a new TLS ?  */
        if (clone_flags & CLONE_SETTLS) {
                unsigned long tls = frame->childregs.gprs[6];