linux-stable/arch/x86/include/asm/fpu
Thomas Gleixner 12f7764ac6 x86/process: Check PF_KTHREAD and not current->mm for kernel threads
switch_fpu_finish() checks current->mm as indicator for kernel threads.
That's wrong because kernel threads can temporarily use a mm of a user
process via kthread_use_mm().

Check the task flags for PF_KTHREAD instead.

Fixes: 0cecca9d03 ("x86/fpu: Eager switch PKRU state")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Rik van Riel <riel@surriel.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20210608144345.912645927@linutronix.de
2021-06-09 10:39:04 +02:00
..
api.h x86/cpufeatures: Force disable X86_FEATURE_ENQCMD and remove update_pasid() 2021-06-03 16:33:09 +02:00
internal.h x86/process: Check PF_KTHREAD and not current->mm for kernel threads 2021-06-09 10:39:04 +02:00
regset.h x86: switch to ->regset_get() 2020-07-27 14:31:07 -04:00
signal.h x86/fpu: Remove fpu->initialized usage in __fpu__restore_sig() 2019-04-09 19:27:29 +02:00
types.h x86/fpu/xstate: Add supervisor PASID state for ENQCMD 2020-09-17 20:22:10 +02:00
xcr.h x86/fpu: Move xgetbv()/xsetbv() into a separate header 2020-09-07 19:54:20 +02:00
xstate.h x86/fpu/xstate: Add supervisor PASID state for ENQCMD 2020-09-17 20:22:10 +02:00