deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

KVM flaw CVE-2026-99312 traces back to the patch that fixed CVE-2022-3344

A KVM bug tracked as CVE-2026-99312 stems from the 2022 fix for CVE-2022-3344, which left a stale nested page table pointer that researchers turned into 127 GB host memory reads.

KVM flaw CVE-2026-99312 traces back to the patch that fixed CVE-2022-3344

A Linux KVM vulnerability disclosed as CVE-2026-99312 has an unusual origin: the faulty behavior was introduced by an earlier security patch. According to a dev.to write-up building on Terra Security's technical analysis, the code that leaves KVM exposed to host memory disclosure and kernel writes arrived with the 2022 fix for CVE-2022-3344, a patch meant to close a different nested virtualization bug.

How a 2022 fix planted the flaw

CVE-2022-3344 concerned a reset that pulled a virtual CPU out of a nested guest while it was still using the nested VM's control block. The remedy moved the CPU back to the outer VM's control block before the nested state was released.

Terra Security found that this change left one related piece of state untouched: the pointer to the nested page table. When an INIT signal arrives while a second-level guest (L2) is active with paging disabled, a vulnerable KVM build can keep a stale MMU context. The correction for CVE-2026-99312 makes that MMU context reset unconditional on the INIT path.

What the bug allows

The stale pointer tells the processor where the nested page table lives, and that table governs how guest addresses become host addresses. If KVM frees the page and the memory is later reused for guest-controlled data, the processor can keep treating that data as translation metadata.

Terra Security demonstrated the consequence in practice: a host memory read of roughly 127 GB on a DigitalOcean droplet, and a 32-byte write to host kernel memory on its own server. Exploitation requires AMD hardware, nested virtualization enabled, root privileges inside the guest, and the relevant reset sequence. ThaiCERT scores the issue at CVSS v3.1 8.8.

Lessons for reviewing security patches

The dev.to piece frames the episode as a broader lesson: patches are additions as well as removals, and review should challenge them like any other change.

Concretely, a fix that changes pointers during reset should prompt reviewers to walk through each path that can trigger a reset, the paging mode in effect, which guest level is active, how deeply guests are nested, and the order in which teardown runs, including cases where state changes land close together or cleanup follows an error.

Regression tests should cover neighboring states that share the changed code, such as paging enabled and disabled, L1 versus L2 context, nested SMM, reset during teardown, and repeated resets. The write-up also argues for asserting that no freed page remains referenced after a reset, since a test that only checks for a crash can miss a stale pointer that stays usable; memory tracking tools, ownership assertions and forced page reuse can make that state visible.

Backports get their own warning. Distribution kernels often rework a mainline fix for older trees, and reviewers need to confirm the security property survives the adaptation. Canary hosts for hypervisor changes should exercise nested virtualization on AMD hardware along with live migration, reset and teardown, and any temporary mitigation such as disabling nested virtualization should be tracked so it can be deliberately rolled back rather than silently becoming permanent.

Patched versions and exposure

According to the write-up, upstream fixed releases are Linux 7.3.5, 6.18.64 and 6.12.118, with mainline commit c7c288d178cb0b78d3464a616b16b1aa0b316049. A downstream package version that appears newer proves nothing on its own; the vendor's mapping between package builds and the fix is what counts.

For exposure assessment, a ZoomEye search for KVM returned 10,738 product fingerprints, but such scans reveal nothing about CPU vendor, nested virtualization settings, kernel build or exploit state. Internal configuration and build evidence remains necessary.

Why it matters

CVE-2026-99312 is a concrete case of a security fix becoming the seed of a later vulnerability. In a hypervisor, a missed state in reset or teardown code does not just affect one process; it can expose the host and neighboring guests. That justifies review depth, test coverage and backport care proportional to the consequence. The same logic extends to any patch touching authentication, authorization, isolation or lifecycle code: ask what the fix assumes, what its cleanup leaves behind, and how those assumptions fail in a state nobody tested.

  • #linux-kernel
  • #kvm
  • #security
  • #virtualization
  • #vulnerability

Related posts