This is a note to let you know that I've just added the patch titled powerpc/ptrace: Preserve previous fprs/vsrs on short regset write to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-ptrace-preserve-previous-fprs-vsrs-on-short-regset-write.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 99dfe80a2a246c600440a815741fd2e74a8b4977 Mon Sep 17 00:00:00 2001 From: Dave Martin <Dave.Martin@xxxxxxx> Date: Thu, 5 Jan 2017 16:50:57 +0000 Subject: powerpc/ptrace: Preserve previous fprs/vsrs on short regset write From: Dave Martin <Dave.Martin@xxxxxxx> commit 99dfe80a2a246c600440a815741fd2e74a8b4977 upstream. Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET to fill all the registers, the thread's old registers are preserved. Fixes: c6e6771b87d4 ("powerpc: Introduce VSX thread_struct and CONFIG_VSX") Signed-off-by: Dave Martin <Dave.Martin@xxxxxxx> Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/powerpc/kernel/ptrace.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -463,6 +463,10 @@ static int fpr_set(struct task_struct *t flush_fp_to_thread(target); + for (i = 0; i < 32 ; i++) + buf[i] = target->thread.TS_FPR(i); + buf[32] = target->thread.fp_state.fpscr; + /* copy to local buffer then write that out */ i = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, -1); if (i) @@ -672,6 +676,9 @@ static int vsr_set(struct task_struct *t flush_altivec_to_thread(target); flush_vsx_to_thread(target); + for (i = 0; i < 32 ; i++) + buf[i] = target->thread.fp_state.fpr[i][TS_VSRLOWOFFSET]; + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, 32 * sizeof(double)); if (!ret) Patches currently in stable-queue which might be from Dave.Martin@xxxxxxx are queue-4.9/arm64-ptrace-preserve-previous-registers-for-short-regset-write-3.patch queue-4.9/arm64-ptrace-reject-attempts-to-set-incomplete-hardware-breakpoint-fields.patch queue-4.9/powerpc-ptrace-preserve-previous-tm-fprs-vsrs-on-short-regset-write.patch queue-4.9/arm64-ptrace-preserve-previous-registers-for-short-regset-write-2.patch queue-4.9/arm64-ptrace-avoid-uninitialised-struct-padding-in-fpr_set.patch queue-4.9/arm64-ptrace-preserve-previous-registers-for-short-regset-write.patch queue-4.9/powerpc-ptrace-preserve-previous-fprs-vsrs-on-short-regset-write.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html