x86/fpu: Reject invalid MXCSR values in copy_kernel_to_xstate()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 23 Jun 2021 12:01:37 +0000 (14:01 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 23 Jun 2021 15:49:46 +0000 (17:49 +0200)
commit947f4947cf00ea1e6d319eb182c64ea51ba4de8d
treedc834bb9da56410ced59d606f7340a4e0ab8cd2e
parent43be46e89698a41dbf4fff81a322f4c2ae21b5e2
x86/fpu: Reject invalid MXCSR values in copy_kernel_to_xstate()

Instead of masking out reserved bits, check them and reject the provided
state as invalid if not zero.

Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121452.308388343@linutronix.de
arch/x86/kernel/fpu/xstate.c