diff options
| author | Josef Bacik <josef@toxicpanda.com> | 2026-10-22 12:29:08 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-11-10 14:38:53 -0800 |
| commit | 809f39842c1706089e0de82b5c1d851d84eec4dc (patch) | |
| tree | 1aa6acb44228f89cc583952306c894505f1d42d1 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | fd3dd4d9c18638fdbeed2985681e90c1585e0ddd (diff) | |
KVM: nVMX: Clear nested.smm.guest_mode when freeing nested state
If an SMI arrives while L2 is active, vmx_enter_smm() forces a VM-Exit
to L1, and records in nested.smm.guest_mode that RSM has to re-enter L2
and in nested.smm.vmxon that the vCPU was post-VMXON. free_nested()
clears the latter, but not the former.
Userspace can get KVM to free the nested state while the vCPU is in SMM,
with KVM_SET_NESTED_STATE, e.g. with no VMXON region to say that the
vCPU isn't in VMX operation, or by flipping the SMM flag back and forth
with KVM_SET_VCPU_EVENTS. When the guest then executes RSM,
vmx_leave_smm() tries to re-enter L2 even though there is no vmcs12 any
more, and nested_vmx_check_restored_vmcs12() dereferences the NULL
nested.cached_vmcs12.
Clear nested.smm.guest_mode along with the state that it refers to.
Fixes: 8fcc4b5923af ("kvm: nVMX: Introduce KVM_CAP_NESTED_STATE")
Reported-by: Karthikeyan Bhargavan <karthik@cryspen.com>
Cc: stable@vger.kernel.org
Assisted-by: LLM
Cc: Chris Mason <mason@kernel.org>
Co-developed-by: Amirmohammad Eftekhar <amirmohammad.eftekhar@cispa.de>
Signed-off-by: Amirmohammad Eftekhar <amirmohammad.eftekhar@cispa.de>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://patch.msgid.link/20261022192908.554376-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions
