Re: [PATCH v3 2/2] KVM: arm64: nv: Fix null ptr deref on nested wp/unmap, teardown race
From: Lorenzo Stoakes (ARM)
Date: Fri Sep 11 2026 - 04:53:39 EST
On Fri, Sep 11, 2026 at 09:12:20AM +0100, Jonathan Davies wrote:
> On Tue, 01 Sep 2026, "Lorenzo Stoakes (ARM)" <ljs@xxxxxxxxxx> wrote:
> > This means that stage2_apply_range() can drop the kvm->mmu_lock and
> > thus concurrent progress can be made in lockstep with
> > kvm_arch_flush_shadow_all().
> >
> > If kvm_arch_flush_shadow_all() advances ahead of stage2_apply_range()
> > and completes its operation it guarantees a NULL pointer deref.
>
> I've reproducibly hit exactly this problem when running nested guests
> with concurrent memory compaction on the L0 host. This patch fixes it
> for me perfectly (applied to a 6.18 kernel).
>
> So, for what it's worth:
>
> Tested-by: Jonathan Davies <jonathan.davies@xxxxxxxxxxx>
Amazing, thanks :)
--
Cheers, Lorenzo