[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <162454926209.395.6930680604405562644.tip-bot2@tip-bot2>
Date: Thu, 24 Jun 2021 15:41:02 -0000
From: "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: kernel test robot <oliver.sang@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...e.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/fpu] x86/fpu/xstate: Clear xstate header in
copy_xstate_to_uabi_buf() again
The following commit has been merged into the x86/fpu branch of tip:
Commit-ID: 93c2cdc975aab53c222472c5b96c2d41dbeb350c
Gitweb: https://git.kernel.org/tip/93c2cdc975aab53c222472c5b96c2d41dbeb350c
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Thu, 24 Jun 2021 17:09:18 +02:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Thu, 24 Jun 2021 17:19:51 +02:00
x86/fpu/xstate: Clear xstate header in copy_xstate_to_uabi_buf() again
The change which made copy_xstate_to_uabi_buf() usable for
[x]fpregs_get() removed the zeroing of the header which means the
header, which is copied to user space later, contains except for the
xfeatures member, random stack content.
Add the memset() back to zero it before usage.
Fixes: eb6f51723f03 ("x86/fpu: Make copy_xstate_to_kernel() usable for [x]fpregs_get()")
Reported-by: kernel test robot <oliver.sang@...el.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Borislav Petkov <bp@...e.de>
Link: https://lkml.kernel.org/r/875yy3wb8h.ffs@nanos.tec.linutronix.de
---
arch/x86/kernel/fpu/xstate.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 21a10a6..c8def1b 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -982,6 +982,7 @@ void copy_xstate_to_uabi_buf(struct membuf to, struct task_struct *tsk,
unsigned int zerofrom;
int i;
+ memset(&header, 0, sizeof(header));
header.xfeatures = xsave->header.xfeatures;
/* Mask out the feature bits depending on copy mode */
Powered by blists - more mailing lists