HIGH Introduced in 6.11
kvm arm64 NestedMMU UAF
CVE-2026-98440
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.0HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: KVM: arm64: nv: Delay freeing of shadow S2 structures until VM destruction We free the shadow S2 structures from kvm_arch_flush_shadow_all(), which is a Bad Idea(tm). Freeing the page tables is fair game (this is what this callback is for), but freeing the container that could still be referenced by another part of the system is not great. Instead, grow separate destructors that gets called when we tear the VM down for good. From there, we can nuke both the individual MMUs as well as the global array that points to them, safe in the knowledge that the vcpus themselves have been destroyed already.
02KernelScan AI Analysis
Risk summary
A use-after-free in the KVM arm64 nested virtualization code allows a local attacker with the ability to create and destroy nested VMs to corrupt kernel memory, potentially leading to privilege escalation or denial of service. The vulnerability is reachable from a user namespace when KVM is enabled and nested virtualization is supported, making it relevant for multi-tenant and container-host environments.
Vulnerability analysis
The KVM arm64 nested virtualization code allocates an array of shadow Stage-2 MMU structures for each VM. A cleanup callback invoked during VM teardown or shadow flush was freeing both the page tables and the container structures while other parts of the system could still hold references to those containers. This creates a use-after-free window where a stale pointer to a freed MMU structure can be dereferenced. The fix moves the freeing of the container structures to a new destructor that runs only after all vCPUs have been destroyed, ensuring no live references remain. The page tables themselves are still freed during the flush callback, which is safe. An attacker who can create nested VMs (requiring CAP_SYS_ADMIN in a user namespace or root in the init namespace) can trigger the vulnerable path by causing repeated VM creation and destruction or shadow flushes, and may be able to exploit the use-after-free for arbitrary kernel memory read/write.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 6.11 | 6.12.113 | 876049f026b4 |
| 6.18 | 6.11 | 6.18.56 | 22e82acec93a |
| 7.2 | 6.11 | 7.2.9 | 5bf1c9175e65 |
| mainline | 6.11 | 7.3 | e5843f4effaa |
| cip/6.12 | 6.11 | 6.12.114-cip34 | 876049f026b4 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |