linux/arch/x86/kernel/fpu
Thomas Gleixner daddee2473 x86/fpu: Mop up xfeatures_mask_uabi()
Use the new fpu_user_cfg to retrieve the information instead of
xfeatures_mask_uabi() which will be no longer correct when dynamically
enabled features become available.

Using fpu_user_cfg is appropriate when setting XCOMP_BV in the
init_fpstate since it has space allocated for "max_features". But,
normal fpstates might only have space for default xfeatures. Since
XRSTOR* derives the format of the XSAVE buffer from XCOMP_BV, this can
lead to XRSTOR reading out of bounds.

So when copying actively used fpstate, simply read the XCOMP_BV features
bits directly out of the fpstate instead.

This correction courtesy of Dave Hansen <dave.hansen@linux.intel.com>

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211014230739.408879849@linutronix.de
2021-10-22 11:04:46 +02:00
..
bugs.c x86/fpu: Replace the includes of fpu/internal.h 2021-10-20 15:27:29 +02:00
context.h x86/fpu: Convert restore_fpregs_from_fpstate() to struct fpstate 2021-10-20 22:26:38 +02:00
core.c x86/fpu: Mop up xfeatures_mask_uabi() 2021-10-22 11:04:46 +02:00
init.c x86/fpu: Move xstate feature masks to fpu_*_cfg 2021-10-21 20:36:58 +02:00
internal.h x86/fpu: Move xstate size to fpu_*_cfg 2021-10-21 19:38:55 +02:00
legacy.h x86/fpu: Move mxcsr related code to core 2021-10-20 15:27:28 +02:00
Makefile
regset.c x86/fpu: Move xstate size to fpu_*_cfg 2021-10-21 19:38:55 +02:00
signal.c x86/fpu: Mop up xfeatures_mask_uabi() 2021-10-22 11:04:46 +02:00
xstate.c x86/fpu: Mop up xfeatures_mask_uabi() 2021-10-22 11:04:46 +02:00
xstate.h x86/fpu: Move xstate size to fpu_*_cfg 2021-10-21 19:38:55 +02:00