This is a note to let you know that I've just added the patch titled KVM: x86/mmu: Check every prev_roots in __kvm_mmu_free_obsolete_roots() to the 5.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kvm-x86-mmu-check-every-prev_roots-in-__kvm_mmu_free_obsolete_roots.patch and it can be found in the queue-5.18 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From cf4a8693d97a51dccf5a1557248d12d6d8be4b9e Mon Sep 17 00:00:00 2001 From: Shaoqin Huang <shaoqin.huang@xxxxxxxxx> Date: Mon, 6 Jun 2022 18:59:05 -0600 Subject: KVM: x86/mmu: Check every prev_roots in __kvm_mmu_free_obsolete_roots() From: Shaoqin Huang <shaoqin.huang@xxxxxxxxx> commit cf4a8693d97a51dccf5a1557248d12d6d8be4b9e upstream. When freeing obsolete previous roots, check prev_roots as intended, not the current root. Signed-off-by: Shaoqin Huang <shaoqin.huang@xxxxxxxxx> Fixes: 527d5cd7eece ("KVM: x86/mmu: Zap only obsolete roots if a root shadow page is zapped") Message-Id: <20220607005905.2933378-1-shaoqin.huang@xxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/kvm/mmu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -5168,7 +5168,7 @@ static void __kvm_mmu_free_obsolete_root roots_to_free |= KVM_MMU_ROOT_CURRENT; for (i = 0; i < KVM_MMU_NUM_PREV_ROOTS; i++) { - if (is_obsolete_root(kvm, mmu->root.hpa)) + if (is_obsolete_root(kvm, mmu->prev_roots[i].hpa)) roots_to_free |= KVM_MMU_ROOT_PREVIOUS(i); } Patches currently in stable-queue which might be from shaoqin.huang@xxxxxxxxx are queue-5.18/kvm-x86-mmu-check-every-prev_roots-in-__kvm_mmu_free_obsolete_roots.patch