Re: [PATCH v2] KVM: x86: Take SRCU in kvm_zap_gfn_range()

From: Sean Christopherson

Date: Mon Sep 21 2026 - 10:33:54 EST


On Wed, 26 Aug 2026 02:39:24 +0800, Chengfeng Ye wrote:
> kvm_zap_gfn_range() walks memslots and rmaps and may drop mmu_lock to
> reschedule. Callers that do not already hold kvm->srcu (or slots_lock)
> can race with memslot deletion: synchronize_srcu_expedited() does not
> wait, kvm_free_memslot() frees the old slot and its rmap, and the zap
> resumes on freed memory.
>
> The VFIO noncoherent-DMA path hits this by zapping the entire GPA
> space without SRCU. KASAN reported:
>
> [...]

Applied to kvm-x86 mmu, thanks!

[1/1] KVM: x86: Take SRCU in kvm_zap_gfn_range()
https://github.com/kvm-x86/linux/commit/b59a87c1ba3c

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