CVE-2026-46113
Awaiting Analysis Awaiting Analysis - Queue
Use-After-Free in Linux Kernel KVM x86 Shadow Paging

Publication date: 2026-05-28

Last updated on: 2026-05-28

Assigner: kernel.org

Description
In the Linux kernel, the following vulnerability has been resolved: KVM: x86: Fix shadow paging use-after-free due to unexpected GFN The shadow MMU computes GFNs for direct shadow pages using sp->gfn plus the SPTE index. This assumption breaks for shadow paging if the guest page tables are modified between VM entries (similar to commit aad885e77496, "KVM: x86/mmu: Drop/zap existing present SPTE even when creating an MMIO SPTE", 2026-03-27). The flow is as follows: - a PDE is installed for a 2MB mapping, and a page in that area is accessed. KVM creates a kvm_mmu_page consisting of 512 4KB pages; the kvm_mmu_page is marked by FNAME(fetch) as direct-mapped because the guest's mapping is a huge page (and thus contiguous). - the PDE mapping is changed from outside the guest. - the guest accesses another page in the same 2MB area. KVM installs a new leaf SPTE and rmap entry; the SPTE uses the "correct" GFN (i.e. based on the new mapping, as changed in the previous step) but that GFN is outside of the [sp->gfn, sp->gfn + 511] range; therefore the rmap entry cannot be found and removed when the kvm_mmu_page is zapped. - the memslot that covers the first 2MB mapping is deleted, and the kvm_mmu_page for the now-invalid GPA is zapped. However, rmap_remove() only looks at the [sp->gfn, sp->gfn + 511] range established in step 1, and fails to find the rmap entry that was recorded by step 3. - any operation that causes an rmap walk for the same page accessed by step 3 then walks a stale rmap and dereferences a freed kvm_mmu_page. This includes dirty logging or MMU notifier invalidations (e.g., from MADV_DONTNEED). The underlying issue is that KVM's walking of shadow PTEs assumes that if a SPTE is present when KVM wants to install a non-leaf SPTE, then the existing kvm_mmu_page must be for the correct gfn. Because the only way for the gfn to be wrong is if KVM messed up and failed to zap a SPTE... which shouldn't happen, but *actually* only happens in response to a guest write. That bug dates back literally forever, as even the first version of KVM assumes that the GFN matches and walks into the "wrong" shadow page. However, that was only an imprecision until 2032a93d66fa ("KVM: MMU: Don't allocate gfns page for direct mmu pages") came along. Fix it by checking for a target gfn mismatch and zapping the existing SPTE. That way the old SP and rmap entries are gone, KVM installs the rmap in the right location, and everyone is happy.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-28
Last Modified
2026-05-28
Generated
2026-05-28
AI Q&A
2026-05-28
EPSS Evaluated
N/A
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
linux_kernel kvm *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
What immediate steps should I take to mitigate this vulnerability?

The vulnerability has been resolved in the Linux kernel by fixing the shadow paging use-after-free issue in KVM's x86 implementation. Immediate mitigation involves updating the Linux kernel to a version that includes this fix.

Since the issue is related to KVM's handling of shadow paging and guest page tables, applying the kernel update that contains the patch will prevent the use-after-free condition.


Can you explain this vulnerability to me?

This vulnerability exists in the Linux kernel's KVM (Kernel-based Virtual Machine) component related to x86 shadow paging. The issue arises because the shadow MMU incorrectly assumes that guest frame numbers (GFNs) for direct shadow pages are always within a certain range. When guest page tables are modified between virtual machine entries, this assumption breaks, leading to a use-after-free condition.

Specifically, when a large page mapping (2MB) is changed by the guest, KVM creates a kvm_mmu_page for the original mapping. If the mapping changes and the guest accesses a different page in the same area, KVM installs a new shadow page table entry (SPTE) with a GFN outside the original range. Because of this, the reverse mapping (rmap) entry cannot be found and removed properly when the kvm_mmu_page is invalidated.

As a result, operations that walk the rmap later may dereference a freed kvm_mmu_page, causing a use-after-free bug. The root cause is that KVM assumes the GFN matches the shadow page, which is not always true after guest modifications. The fix involves checking for GFN mismatches and properly zapping the old SPTE to prevent stale references.


How can this vulnerability impact me? :

This vulnerability can lead to a use-after-free condition within the KVM virtualization subsystem of the Linux kernel. Such a condition may cause system instability, crashes, or potentially allow an attacker with guest privileges to execute arbitrary code or escalate privileges on the host system.

Because the bug involves dereferencing freed memory due to stale reverse mappings, it could be exploited to compromise the integrity and security of the host running virtual machines, impacting the confidentiality, integrity, and availability of the system.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart