HIGH Introduced in 5.4
kvm NestedStatePages UAF
CVE-2026-98863
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: KVM: x86: Re-pend GET_NESTED_STATE_PAGES if getting said pages fails Re-pend GET_NESTED_STATE_PAGES before exiting to userspace if getting the nested pages fails in the KVM_RUN path. If userspace re-runs the vCPU, and vmcs02 holds valid PFNs from the *previous* run of L2, then KVM could re-enter L2 with stale, unpinned PFNs mapped into e.g. the vAPIC page. Note, both SVM and VMX (as of commit 11722439fb20 ("KVM: nVMX: Ensure KVM_REQ_GET_NESTED_STATE_PAGES is cleared on VM-Exit") ensure the request is cleared on VM-Exit (including the "forced" case), i.e. there is no risk of double-mapping due to emulated VMLAUNCH/VMRESUME/VMRUN *and* the request trying to map the nested pages.
02KernelScan AI Analysis
Risk summary
Local users with access to KVM (e.g., via the `kvm` group) can exploit a use-after-free in nested virtualization page handling to achieve arbitrary kernel memory read/write and privilege escalation. The bug requires a nested guest (L2) configuration and the ability to trigger page-pinning failures, making it primarily a risk in multi-tenant virtualization and container-host deployments where untrusted workloads manage VMs.
Vulnerability analysis
In the KVM x86 nested virtualization code, when the hypervisor fails to acquire and pin the nested guest's state pages (such as the vAPIC page) during a vCPU run, it exits to userspace without re-queuing the request. If userspace subsequently re-runs the vCPU, the previous run's page frame numbers (PFNs) remain valid in the nested VMCS (vmcs02) but are no longer pinned, allowing KVM to re-enter the L2 guest with stale mappings to potentially freed or reused host pages. This creates a use-after-free condition where attacker-controlled memory can be mapped into sensitive structures like the virtual APIC page. The fix ensures the `KVM_REQ_GET_NESTED_STATE_PAGES` request is re-pended before returning to userspace, forcing a fresh page acquisition attempt on the next KVM_RUN invocation. The vulnerability is locally exploitable by any user with access to the `/dev/kvm` interface (typically members of the `kvm` group) who can orchestrate a nested virtualization scenario and induce page-pinning failures, making it relevant in multi-tenant and container-host environments.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 5.4 | 6.18.56 | 525694a6021e |
| 7.2 | 5.4 | 7.2.10 | 942192dbcd3a |
| mainline | 5.4 | 7.3 | 10180a277549 |
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 | Affected — no CIP fix yet (latest 6.12.114-cip34) |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |