stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: Dave.Martin@arm.com, gregkh@linuxfoundation.org, mpe@ellerman.id.au
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write" has been added to the 4.9-stable tree
Date: Mon, 23 Jan 2017 15:36:21 +0100	[thread overview]
Message-ID: <148518218118980@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    powerpc/ptrace: Preserve previous TM 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-tm-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@vger.kernel.org> know about it.


>From b34ca60148c53971d373643195cc5c4d5d20be78 Mon Sep 17 00:00:00 2001
From: Dave Martin <Dave.Martin@arm.com>
Date: Thu, 5 Jan 2017 16:50:57 +0000
Subject: powerpc/ptrace: Preserve previous TM fprs/vsrs on short regset write

From: Dave Martin <Dave.Martin@arm.com>

commit b34ca60148c53971d373643195cc5c4d5d20be78 upstream.

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the check pointed registers, the thread's old check pointed
registers are preserved.

Fixes: 9d3918f7c0e5 ("powerpc/ptrace: Enable support for NT_PPC_CVSX")
Fixes: 19cbcbf75a0c ("powerpc/ptrace: Enable support for NT_PPC_CFPR")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/ptrace.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1026,6 +1026,10 @@ static int tm_cfpr_set(struct task_struc
 	flush_fp_to_thread(target);
 	flush_altivec_to_thread(target);
 
+	for (i = 0; i < 32; i++)
+		buf[i] = target->thread.TS_CKFPR(i);
+	buf[32] = target->thread.ckfp_state.fpscr;
+
 	/* copy to local buffer then write that out */
 	i = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, -1);
 	if (i)
@@ -1290,6 +1294,9 @@ static int tm_cvsx_set(struct task_struc
 	flush_altivec_to_thread(target);
 	flush_vsx_to_thread(target);
 
+	for (i = 0; i < 32 ; i++)
+		buf[i] = target->thread.ckfp_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@arm.com 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

                 reply	other threads:[~2017-01-23 14:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148518218118980@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Dave.Martin@arm.com \
    --cc=mpe@ellerman.id.au \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).