]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Reset permission and fpstate on exec()
authorChang S. Bae <chang.seok.bae@intel.com>
Thu, 21 Oct 2021 22:55:15 +0000 (15:55 -0700)
committerBorislav Petkov <bp@suse.de>
Tue, 26 Oct 2021 08:18:09 +0000 (10:18 +0200)
commit396527ba3e425c3348e443bef09658b4649abc8d
tree33548d18ca0cb7c8bda2d0ad25efef0f875b42c3
parentdcca27d7f2be205fedb96309e1804c14de7815cb
x86/fpu: Reset permission and fpstate on exec()

On exec(), extended register states saved in the buffer is cleared. With
dynamic features, each task carries variables besides the register states.
The struct fpu has permission information and struct fpstate contains
buffer size and feature masks. They are all dynamically updated with
dynamic features.

Reset the current task's entire FPU data before an exec() so that the new
task starts with default permission and fpstate.

Rename the register state reset function because the old naming confuses as
it does not reset struct fpstate.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211021225527.10184-12-chang.seok.bae@intel.com
arch/x86/kernel/fpu/core.c