mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/fpu: remove memset call for xmm registers on xfpregs_set
@ 2022-01-25  2:20 Luís Ferreira
  2022-01-25 10:12 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Luís Ferreira @ 2022-01-25  2:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: bp, Luís Ferreira

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-25 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25  2:20 [PATCH] x86/fpu: remove memset call for xmm registers on xfpregs_set Luís Ferreira
2022-01-25 10:12 ` Borislav Petkov

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®