[PATCH 0/2] KVM: nVMX: Fix a (benign) overwrite to a userspace buffer
From: Sean Christopherson
Date: Wed Oct 21 2026 - 22:18:28 EST
Fix a bug where KVM writes more bytes for KVM_GET_NESTED_STATE than it reports
in the output size if L1 is active and has a valid shadow VMCS pointer. The
bug is all but guaranteed to be benign in practice, as all VMMs I could find
that support nested virtualization just preallocate the max buffer size.
Sean Christopherson (2):
KVM: nVMX: Save shadow VMCS when getting nested state iff L2 is active
KVM: selftests: Add regression test for KVM writing but not reporting
vmcs12
arch/x86/kvm/vmx/nested.c | 2 +-
.../testing/selftests/kvm/lib/x86/processor.c | 6 +++++
tools/testing/selftests/kvm/x86/state_test.c | 24 ++++++++++---------
3 files changed, 20 insertions(+), 12 deletions(-)
base-commit: 164405e8e9a0378c7e1aff2254625a6553a291f1
--
2.56.0.218.g1ec904b173-goog