Commit 0726e8b7 authored by Chang S. Bae's avatar Chang S. Bae Committed by Lin Wang
Browse files

x86/fpu: Fix the init_fpstate size check with the actual size

mainline inclusion
from mainline-v6.1-rc2
commit d3e021ad
category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I73H0T
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d3e021adac7c51a26d9ede167c789fcc1b878467



Intel-SIG: commit d3e021ad x86/fpu: Fix the init_fpstate size check
with the actual size.

--------------------------------

The init_fpstate buffer is statically allocated. Thus, the sanity test was
established to check whether the pre-allocated buffer is enough for the
calculated size or not.

The currently measured size is not strictly relevant. Fix to validate the
calculated init_fpstate size with the pre-allocated area.

Also, replace the sanity check function with open code for clarity. The
abstraction itself and the function naming do not tend to represent simply
what it does.

Fixes: 2ae996e0 ("x86/fpu: Calculate the default sizes independently")
Signed-off-by: default avatarChang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220824191223.1248-3-chang.seok.bae@intel.com


Signed-off-by: default avatarLin Wang <lin.x.wang@intel.com>
parent 24ab4cb0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment