Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [Bug 221841] New: KVM: nested VMX eVMCS VMPTRLD/VMPTRST causes infinite VM-Exit loop due to missing RIP advance
@ 2026-08-06  7:11 bugzilla-daemon
  2026-08-06 14:01 ` Sean Christopherson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: bugzilla-daemon @ 2026-08-06  7:11 UTC (permalink / raw)
  To: kvm

https://bugzilla.kernel.org/show_bug.cgi?id=221841

            Bug ID: 221841
           Summary: KVM: nested VMX eVMCS VMPTRLD/VMPTRST causes infinite
                    VM-Exit loop due to missing RIP advance
           Product: Virtualization
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: high
          Priority: P3
         Component: kvm
          Assignee: virtualization_kvm@kernel-bugs.osdl.org
          Reporter: f734222792@gmail.com
        Regression: No

Created attachment 310582
  --> https://bugzilla.kernel.org/attachment.cgi?id=310582&action=edit
Proof-of-concept exploit demonstrating infinite VM-Exit loop caused by missing
RIP advancement in KVM nested VMX eVMCS VMPTRLD handler.

When eVMCS (enlightened VMCS, Hyper-V enlightened VMCS) is enabled, 
the nested VMX handlers for VMPTRLD and VMPTRST return directly without 
advancing the guest instruction pointer (RIP).

Affected code paths:

arch/x86/kvm/vmx/nested.c

handle_vmptrld():
    if (evmcs)
        return 1;

handle_vmptrst():
    if (evmcs)
        return 1;


Unlike other VMX instruction handlers, these paths do not call:

- kvm_skip_emulated_instruction()
- nested_vmx_succeed()
- nested_vmx_fail()
- nested_vmx_failInvalid()

Therefore, the L1 guest RIP remains unchanged after VM-Exit handling.

Reproduction logic:

1. Enable nested VMX with Hyper-V enlightened VMCS (eVMCS).
2. Run an L1 guest.
3. Execute VMPTRLD or VMPTRST instruction inside L1 guest.

Execution flow:

L1 guest executes VMPTRLD
        |
        v
VM-Exit to L0 KVM
        |
        v
handle_vmptrld()
        |
        v
if (evmcs)
        return 1;
        |
        v
No RIP advance
        |
        v
VM-Entry resumes L1 guest
        |
        v
Same VMPTRLD instruction executes again

This creates an infinite VM-Exit loop.

Impact:

A malicious L1 guest can continuously trigger VM-Exit handling and consume
host CPU resources, resulting in denial of service.

The issue affects availability only.




Technical analysis:

The eVMCS path should behave similarly to other unsupported nested VMX
instructions.

For example, handle_vmread() correctly handles eVMCS:

    if (evmcs)
        return nested_vmx_failInvalid(vcpu);

which advances RIP through the normal VMX failure handling path.

However, handle_vmptrld() and handle_vmptrst() only return 1 without
instruction advancement.


Suggested fix:

Replace the direct return:

    if (evmcs)
        return 1;

with an error handling path that advances RIP, for example:

    if (evmcs)
        return nested_vmx_fail(vcpu,
            VMXERR_VMPTRLD_VMPTRST_WITH_EVMCS_NOT_SUPPORTED);

or at minimum explicitly call:

    kvm_skip_emulated_instruction(vcpu);


Verification:

Confirmed:

1. eVMCS VMPTRLD/VMPTRST paths contain direct return 1.
2. No RIP advancement occurs.
3. vmx_handle_exit does not automatically advance RIP.
4. VMX instructions executed in non-root mode always cause VM-Exit.
5. The issue reproduces as an endless VM-Exit loop under eVMCS.


Workaround:

Disable Hyper-V enlightened VMCS / eVMCS support.

No known CVE assigned.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-07 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06  7:11 [Bug 221841] New: KVM: nested VMX eVMCS VMPTRLD/VMPTRST causes infinite VM-Exit loop due to missing RIP advance bugzilla-daemon
2026-08-06 14:01 ` Sean Christopherson
2026-08-06 14:01 ` [Bug 221841] " bugzilla-daemon
2026-08-07  9:17 ` bugzilla-daemon
2026-08-07 13:56   ` Sean Christopherson
2026-08-07 13:56 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox