]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 5 May 2022 07:14:18 +0000 (09:14 +0200)
commitd43c57a1713ef73f5c423efecaa061ec4e448287
tree951a93bffacdf449c5ba964c5de66abdf3461927
parent1aa3e7b9c4a98a45a6cca6adb27af75e5eea33ab
x86/fpu: Reset permission and fpstate on exec()

BugLink: https://bugs.launchpad.net/bugs/1967750
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
(cherry picked from commit e61d6310a0f80cb986fd2076d432760b3619fb6d)
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/kernel/fpu/core.c