summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/fpu/core.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-10-13 16:55:45 +0200
committerBorislav Petkov <bp@suse.de>2021-10-21 09:33:41 +0200
commit2dd8eedc80b184bb16aad697ae60367c5bf07299 (patch)
tree751dd0796faddfc6a1abc42d5d558c549c07f7c4 /arch/x86/kernel/fpu/core.c
parentf0cbc8b3cdf7d1c724155cd9cecffe329bb96119 (diff)
downloadlinux-stable-2dd8eedc80b184bb16aad697ae60367c5bf07299.tar.gz
linux-stable-2dd8eedc80b184bb16aad697ae60367c5bf07299.tar.bz2
linux-stable-2dd8eedc80b184bb16aad697ae60367c5bf07299.zip
x86/process: Move arch_thread_struct_whitelist() out of line
In preparation for dynamically enabled FPU features move the function out of line as the goal is to expose less and not more information. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211013145322.869001791@linutronix.de
Diffstat (limited to 'arch/x86/kernel/fpu/core.c')
-rw-r--r--arch/x86/kernel/fpu/core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
index 14560fda15c2..c6df97517ec8 100644
--- a/arch/x86/kernel/fpu/core.c
+++ b/arch/x86/kernel/fpu/core.c
@@ -405,6 +405,16 @@ int fpu_clone(struct task_struct *dst)
}
/*
+ * Whitelist the FPU register state embedded into task_struct for hardened
+ * usercopy.
+ */
+void fpu_thread_struct_whitelist(unsigned long *offset, unsigned long *size)
+{
+ *offset = offsetof(struct thread_struct, fpu.__fpstate.regs);
+ *size = fpu_kernel_xstate_size;
+}
+
+/*
* Drops current FPU state: deactivates the fpregs and
* the fpstate. NOTE: it still leaves previous contents
* in the fpregs in the eager-FPU case.