diff options
| author | Sean Christopherson <[email protected]> | 2024-09-06 04:34:13 +0000 |
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2024-09-10 03:15:03 +0000 |
| commit | 3dde46a21aa72a3640bf3f6ff5ce7838af06a1f9 (patch) | |
| tree | 52c60212980d73a6b16b3f3e96b6109e5b17c735 /lib/crypto/mpi/mpi-mul.c | |
| parent | KVM: nVMX: Explicitly invalidate posted_intr_nv if PI is disabled at VM-Enter (diff) | |
| download | kernel-3dde46a21aa72a3640bf3f6ff5ce7838af06a1f9.tar.gz kernel-3dde46a21aa72a3640bf3f6ff5ce7838af06a1f9.zip | |
KVM: nVMX: Assert that vcpu->mutex is held when accessing secondary VMCSes
Add lockdep assertions in get_vmcs12() and get_shadow_vmcs12() to verify
the vCPU's mutex is held, as the returned VMCS objects are dynamically
allocated/freed when nested VMX is turned on/off, i.e. accessing vmcs12
structures without holding vcpu->mutex is susceptible to use-after-free.
Waive the assertion if the VM is being destroyed, as KVM currently forces
a nested VM-Exit when freeing the vCPU. If/when that wart is fixed, the
assertion can/should be converted to an unqualified lockdep assertion.
See also https://lore.kernel.org/all/[email protected].
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions
