OSDN Git Service

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)
commite61d6310a0f80cb986fd2076d432760b3619fb6d
tree33548d18ca0cb7c8bda2d0ad25efef0f875b42c3
parent9e798e9aa14c45fb94e47b30bf6347b369ce9df7
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