[PATCH v3 2/2] KVM: arm64: nv: Fix null ptr deref on nested wp/unmap, teardown race

Jonathan Davies jonathan.davies at nutanix.com
Fri Sep 11 01:12:20 PDT 2026


On Tue, 01 Sep 2026, "Lorenzo Stoakes (ARM)" <ljs at kernel.org> 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 at nutanix.com>



More information about the linux-arm-kernel mailing list