Re: [PATCH 0/2] KVM: x86: Reset MMU back to the root MMU when leaving guest mode

From: Sean Christopherson

Date: Fri Nov 13 2026 - 14:43:23 EST


On Thu, 15 Oct 2026 10:31:21 +0200, Paolo Bonzini wrote:
> Fix a bug where KVM fails to unwind vcpu->arch.mmu back to the root MMU after
> leaving guest mode on a failed entry to L2 via RSM or KVM_SET_NETSED_STATE.
> If KVM also frees nested state before the next entry to L1 (or maybe even
> after?), trying to construct the shadow root will hit a NULL pointer deref
> when trying to get vmcs12->eptp.
>
> The only known instance of the bug is in patch 1; Sean's patch 2 avoids
> the moving the reset to the place where the vCPU goes back to L1 for both
> nSVM and nVMX. However, it conflicts with pre-7.3 code due to the separation
> of kvm_mmu and kvm_pagewalk; and it will also conflict with the stable-worthy
> v3 of https://lore.kernel.org/kvm/20261011001303.723721-1-mlevitsk@xxxxxxxxxx/,
> so it will only be applied to kvm/next.
>
> [...]

Applied patch 2 to kvm-x86 misc, thanks!

[1/2] KVM: nVMX: Reset MMU back to the root MMU if loading L2 state fails for !VM-Entry
[already upstream]
[2/2] KVM: x86: Reset MMU back to the root MMU when leaving guest mode
https://github.com/kvm-x86/linux/commit/c0e3a3724c53

--
https://github.com/kvm-x86/linux/tree/next