HIGH Introduced in 4.2
kvm SMM MMIOCache TOCTOU
CVE-2026-99082
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: KVM: x86: Use active memslots for the per-vCPU MMIO cache KVM tags the per-vCPU MMIO cache with a memslot generation so that a memslot update invalidates cached MMIO information. Both the fill and validation paths use kvm_memslots(), which unconditionally selects address space 0, even when the vCPU is running in SMM and using address space 1. Commit 56f17dd3fbc4 ("kvm: x86: fix stale mmio cache bug") added the memslot generation to the cache key so that a memslot update could not leave a stale entry valid. When commit 699023e23965 ("KVM: x86: add SMM to the MMU role, support SMRAM address space") added the SMM address space, these helpers were not converted to use the active memslots. Consequently, an update to the SMM memslots can leave an entry from the old SMM address space apparently valid after the vCPU returns to the normal address space. A guest can then cause an access to valid RAM at the same GFN to be returned to userspace as KVM_EXIT_MMIO. Completing that exit through the VMM's RAM address space writes the backing page without going through KVM's write-tracking path. If the page backs a nested EPT table, KVM can continue using shadow translations derived from the old contents. The WARN_ON_ONCE() in kvm_mmu_write_protect_fault() catches this invalid cache and memslot combination. Use the vCPU's active memslots when caching and validating the entry. Memslot generations are unique across address spaces, so the generation also distinguishes the normal and SMM views. This matches the MMIO SPTE cache, which already uses kvm_vcpu_memslots(). On an unpatched current-mainline kernel, a regression test that fills the cache in SMM and updates only the SMM memslots fails the intended RAM write and triggers the kvm_mmu_write_protect_fault() warning. With this change, the same test completes the RAM write without a warning. The x86/smm_test, set_memory_region_test, and memslot_modification_stress_test selftests also pass.
02KernelScan AI Analysis
Risk summary
A guest VM running in SMM can exploit a stale MMIO cache entry after the host updates SMM memslots, causing the VMM to write to guest RAM without KVM's write tracking. This can corrupt nested EPT tables and allow the guest to escape to the host kernel. The vulnerability affects multi-tenant KVM deployments where guests are untrusted and SMM with nested virtualization is enabled.
Vulnerability analysis
KVM's per-vCPU MMIO cache uses a generation number to detect when memory slot changes should invalidate cached entries. When support for System Management Mode (SMM) was added with a separate memory address space, the cache logic was not updated to use the active address space's generation number. Instead, it continued using the default address space's generation. This means an update to the SMM memory slots changes the SMM generation, but the cache still validates against the unchanged default generation. A guest can exploit this by filling the cache while in SMM, having the host update SMM memory slots, exiting SMM, and then accessing the same guest frame number — which is now valid RAM but incorrectly triggers an MMIO exit. The host's virtual machine monitor then writes to the backing page without KVM's write tracking, potentially corrupting nested EPT page tables. The fix makes the cache use the vCPU's currently active memory slots so the generation matches the current address space. Exploitation requires a guest with SMM and nested virtualization enabled, and the host must update SMM memory slots during the attack window — typically a cloud tenant running an untrusted guest on a KVM host with nested virtualization configured.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 4.2 | 5.10.273 | 485a5286675b |
| 5.15 | 4.2 | 5.15.224 | 445e3369ac8c |
| 6.1 | 4.2 | 6.1.191 | 1c77d33d8578 |
| 6.12 | 4.2 | 6.12.114 | 7fd4e64f4bbc |
| 6.18 | 4.2 | 6.18.58 | 2566780c684c |
| 6.6 | 4.2 | 6.6.160 | a63f79d9da94 |
| 7.2 | 4.2 | 7.2.12 | e792a9ace39d |
| mainline | 4.2 | 7.3 | b3e6212dea2e |
| cip/6.12 | 4.2 | 6.12.114-cip34 | 7fd4e64f4bbc |
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 |
| 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) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip137) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip137-rt51) |
| cip/4.4 | Affected — no CIP fix yet (latest 4.4.302-cip116) |
| cip/4.4-rt | Affected — no CIP fix yet (latest 4.4.302-cip115-rt63) |