HIGH Introduced in 6.1
kvm MmuContext UAF
CVE-2026-99312
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: Unconditionally reset MMU context when emulating INIT Force an MMU reset when emulating an INIT even if paging was already disabled, as the MMU page role includes guest_mode (L2), i.e. an INIT while L2 is running with CR0.PG=0 will result in KVM running L1 with a stale MMU context. Alternatively, the reset could be scoped strictly to paging being enabled or L2 being active, but SMM is also encoded in the page role. Even though it _should_ be impossible for the vCPU to be INIT'd while SMM is active, there's zero value in not handling SMM. At that point, the only scenario where KVM _doesn't_ need to reset the MMU context is on an INIT with the vCPU running in Real Mode or Unpaged Protect Mode, and while INIT in those modes is somewhat common, it's far from a hot path and re-initializing the MMU is not expensive, especially when the role isn't changing (KVM elides most of the re-configuration in that case). Note, like the Fixes commit, this bug only affects nested SVM as INIT is an unconditional intercept on VMX, i.e. it's impossible to emulate INIT while L2 is active. Temporarily keep the guest TLB flush when CR0.PG is being cleared even though it is fully redundant with the flush that is emitted on all INIT events (KVM itself only does RESET when a vCPU is being created, i.e. when CR0.PG must be '0').
02KernelScan AI Analysis
Risk summary
A use-after-free in KVM's nested SVM implementation allows a malicious L1 guest to corrupt host kernel memory by triggering an INIT signal on an L2 vCPU running with paging disabled. This leads to a stale MMU context being used after the nested guest state is freed, enabling privilege escalation from guest to host.
Vulnerability analysis
When emulating an INIT event on a vCPU running in nested mode (L2 guest) with paging disabled (CR0.PG=0), KVM's x86 SVM implementation failed to reset the MMU context because the reset was gated on paging being enabled. The MMU page role encodes the guest mode (L2) and SMM state, so skipping the reset left a stale context pointing to the L2's nested state (vmcb02). After the INIT, KVM continued running the L1 guest with this stale context, causing a use-after-free when the L2 nested state was later freed. The fix unconditionally resets the MMU context during INIT emulation regardless of paging state, ensuring guest_mode and SMM bits are always cleared. The vulnerability is reachable by a privileged entity (CAP_SYS_ADMIN) controlling an L1 guest with nested virtualization enabled on AMD hardware, such as a compromised management daemon or a container with user-namespace CAP_SYS_ADMIN.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.15 | 5.15.81 | 5.16 | f55a3e4e08dc |
| 6.0 | 6.0.11 | 6.1 | 24f644ea26c2 |
| 6.12 | 6.1 | 6.12.118 | d47bae9eb33b |
| 6.18 | 6.1 | 6.18.64 | c7c288d178cb |
| 7.3 | 6.1 | 7.3.5 | — |
| mainline | 6.1 | 7.4-rc2 | — |
| cip/6.12 | 6.1 | 6.12.118-cip136 | f55a3e4e08dc |
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.118-cip136 |
| 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) |