mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Luís Ferreira" <contact@lsferreira.net>
To: linux-kernel@vger.kernel.org
Cc: bp@alien8.de, "Luís Ferreira" <contact@lsferreira.net>
Subject: [PATCH] x86/fpu: remove memset call for xmm registers on xfpregs_set
Date: Tue, 25 Jan 2022 02:20:15 +0000	[thread overview]
Message-ID: <20220125022015.874422-1-contact@lsferreira.net> (raw)

This patch fixes https://bugzilla.kernel.org/show_bug.cgi?id=215524 by removing
the memset introduced by 6164331d15f7d912fb9369245368e9564ea49813, which
created a regression on ptrace PTRACE_SETREGSET request with NT_FPREGSET.
Particularly, it zeros some XMM registers on the wrong offsets. Fixing the offsets
only solves the problem for i686, which doesn't include xmm8-15 registers, so
the right way is to probably completely remove this call.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
---
 arch/x86/kernel/fpu/regset.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kernel/fpu/regset.c b/arch/x86/kernel/fpu/regset.c
index 437d7c930c0b..aec6c49029b1 100644
--- a/arch/x86/kernel/fpu/regset.c
+++ b/arch/x86/kernel/fpu/regset.c
@@ -116,9 +116,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
 	/* Copy the state  */
 	memcpy(&fpu->fpstate->regs.fxsave, &newstate, sizeof(newstate));
 
-	/* Clear xmm8..15 */
 	BUILD_BUG_ON(sizeof(fpu->__fpstate.regs.fxsave.xmm_space) != 16 * 16);
-	memset(&fpu->fpstate->regs.fxsave.xmm_space[8], 0, 8 * 16);
 
 	/* Mark FP and SSE as in use when XSAVE is enabled */
 	if (use_xsave())
-- 
2.34.1


             reply	other threads:[~2022-01-25  6:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  2:20 Luís Ferreira [this message]
2022-01-25 10:12 ` Borislav Petkov

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=20220125022015.874422-1-contact@lsferreira.net \
    --to=contact@lsferreira.net \
    --cc=bp@alien8.de \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®