[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220125022015.874422-1-contact@lsferreira.net>
Date: Tue, 25 Jan 2022 02:20:15 +0000
From: Luís Ferreira <contact@...erreira.net>
To: linux-kernel@...r.kernel.org
Cc: bp@...en8.de,
Luís Ferreira <contact@...erreira.net>
Subject: [PATCH] x86/fpu: remove memset call for xmm registers on xfpregs_set
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@...erreira.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
Powered by blists - more mailing lists