Commit 9bc610b
committed
KVM: x86: Harden KVM against imbalanced load/put of guest FPU state
Assert, via KVM_BUG_ON(), that guest FPU state isn't/is in use when
loading/putting the FPU to help detect KVM bugs without needing an assist
from KASAN. If an imbalanced load/put is detected, skip the redundant
load/put to avoid clobbering guest state and/or crashing the host.
Note, kvm_access_xstate_msr() already provides a similar assertion.
Reviewed-by: Yao Yuan <yaoyuan@linux.alibaba.com>
Reviewed-by: Chao Gao <chao.gao@intel.com>
Link: https://patch.msgid.link/20251030185802.3375059-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent 8819a49 commit 9bc610b
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11807 | 11807 | | |
11808 | 11808 | | |
11809 | 11809 | | |
| 11810 | + | |
| 11811 | + | |
| 11812 | + | |
11810 | 11813 | | |
11811 | 11814 | | |
11812 | 11815 | | |
| |||
11815 | 11818 | | |
11816 | 11819 | | |
11817 | 11820 | | |
| 11821 | + | |
| 11822 | + | |
| 11823 | + | |
11818 | 11824 | | |
11819 | 11825 | | |
11820 | 11826 | | |
| |||
0 commit comments