Skip to content

KVM: nVMX: propperly handle enlightened vmptrld failure conditions

Vitaly Kuznetsov kvm lkml oe-kbuild-all 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6KVM: nVMX: avoid NULL pointer dereference with incorrect EVMCS GPAsarch/x86/kvm/vmx/nested.c+3 -20 replies
2/6KVM: nVMX: stop abusing need_vmcs12_to_shadow_sync for eVMCS mappingarch/x86/kvm/vmx/nested.c+13 -110 replies
3/6KVM: nVMX: properly handle errors in nested_vmx_handle_enlightened_vmptrld()arch/x86/kvm/vmx/evmcs.h arch/x86/kvm/vmx/nested.c+36 -102 replies
4/6KVM: selftests: define and use EVMCS_VERSIONtools/testing/selftests/kvm/include/evmcs.h tools/testing/selftests/kvm/lib/x86_64/vmx.c+3 -10 replies
5/6KVM: selftests: test enlightened vmenter with wrong eVMCS versiontools/testing/selftests/kvm/x86_64/evmcs_test.c+9 -40 replies
6/6KVM: selftests: enlightened VMPTRLD with an incorrect GPAtools/testing/selftests/kvm/x86_64/evmcs_test.c+10 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] KVM: nVMX: propperly handle enlightened vmptrld failure conditions

Miaohe Lin noticed that we incorrectly handle enlightened vmptrld failures in nested_vmx_run(). Trying to handle errors correctly, I fixed a few things:
- NULL pointer dereference with invalid eVMCS GPAs [PATCH1]
- moved eVMCS mapping after migration to nested_get_vmcs12_pages() from nested_sync_vmcs12_to_shadow() [PATCH2]
- added propper nested_vmx_handle_enlightened_vmptrld() error handling [PATCH3]
- added selftests for incorrect eVMCS revision id and GPA [PATCHes4-6]

PATCH1 fixes a DoS and thus marked for stable@.

Vitaly Kuznetsov (6):
KVM: nVMX: avoid NULL pointer dereference with incorrect EVMCS GPAs
KVM: nVMX: stop abusing need_vmcs12_to_shadow_sync for eVMCS mapping
KVM: nVMX: properly handle errors in
nested_vmx_handle_enlightened_vmptrld()
KVM: selftests: define and use EVMCS_VERSION
KVM: selftests: test enlightened vmenter with wrong eVMCS version
KVM: selftests: enlightened VMPTRLD with an incorrect GPA

 arch/x86/kvm/vmx/evmcs.h                      |  7 ++
 arch/x86/kvm/vmx/nested.c                     | 64 +++++++++++++------
 tools/testing/selftests/kvm/include/evmcs.h   |  2 +
 tools/testing/selftests/kvm/lib/x86_64/vmx.c  |  2 +-
 .../testing/selftests/kvm/x86_64/evmcs_test.c | 25 ++++++--
 5 files changed, 72 insertions(+), 28 deletions(-)
Signature · 1 line
2.24.1