CVE-2026-98467: KVM: arm64: nv: Fix null ptr deref on nested wp/unmap, teardown race
In the Linux kernel, the following vulnerability has been resolved:
KVM: arm64: nv: Fix null ptr deref on nested wp/unmap, teardown race
Commit 7270cc9157f4 ("KVM: arm64: nv: Handle VNCREL2 invalidation from MMU notifiers") introduced VNCREL2 invalidation in both kvmnesteds2unmap() and kvmnesteds2wp().
However at the point of this being performed concurrent stage 2 teardown of a nested guest can cause kvm->arch.mmu.pgt to be set to NULL.
This happens in kvmflushshadowall() -> kvmarchflushshadowall() -> kvmfreestage2pgd() and is performed under the kvm->mmulock.
Commit ec14c272408a ("KVM: arm64: nv: Unmap/flush shadow stage 2 page tables") introduced the teardown of the entire nested MMU range, which then invokes stage2applyrange() with resched=true:
mmunotifierinvalidaterangestart() -> ... -> kvmmmunotifierinvalidaterangestart() -> kvmmmuunmapgfnrange() -> kvmunmapgfnrange() -> kvmnesteds2unmap() -> kvmstage2unmaprange() -> unmapstage2range() -> stage2applyrange()
This means that stage2applyrange() can drop the kvm->mmulock and thus concurrent progress can be made in lockstep with kvmarchflushshadowall().
If kvmarchflushshadowall() advances ahead of stage2applyrange() and completes its operation it guarantees a NULL pointer deref.
Since kvmfreestage2pgd() is performed under the kvm->mmulock this will either be observed NULL or not and serialised against kvmfreestage2pgd().
Resolve the issue by abstracting the invalidation to a new function, kvminvalidatevncripaall(), and check that the pgt is non-NULL before dereferencing it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-hwe-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1~24.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 7.0.0-42.42 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 7.0.0-1016.17 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 7.0.0-1016.18 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oem-7.0to a version that resolves this vulnerability.Fixed in 7.0.0-1017.17 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 7.0.0-1015.16 - Upgrade
Upgrade
ubuntu/linux-riscvto a version that resolves this vulnerability.Fixed in 7.0.0-42.42.1
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The affected code is in the Linux kernel's KVM arm64 nested-virtualization path. Systems that do not use KVM on arm64 with nested guests are not implicated by the described execution path.
What conditions are required to trigger the crash?
A nested stage-2 write-protect or unmap operation must run while a nested guest's stage-2 page tables are being torn down concurrently. The race is possible because stage2_apply_range() can drop kvm->mmu_lock, allowing teardown to set kvm->arch.mmu.pgt to NULL before the invalidation accesses it.
Are fixes available for this issue?
The provided references identify stable-kernel fixes at commits 970de111c087488e53cadf5480b94e0f695db985, 3cefc1ab511fad6a0f708e7a4aee9f91346e9457, and 4c74e233cdedd11592775fae2a6243e67ca3f891. No affected or fixed kernel version ranges are provided.