CVE-2026-64104 Overview
CVE-2026-64104 affects the Linux kernel's AMD Secure Encrypted Virtualization (SEV) guest driver. The vulnerability resides in the virt: sev-guest subsystem, where the driver mishandles pages that fail state transitions via set_memory_encrypted() or set_memory_decrypted(). When these calls fail, the caller cannot determine at which point the failure occurred, leaving pages in an unknown encryption state. Returning such pages to the buddy allocator risks reintroducing unencrypted memory into general kernel use, undermining the confidentiality guarantees of SEV guests.
Critical Impact
Confidentiality and integrity guarantees of AMD SEV guests may be compromised when unencrypted pages are returned to the general memory pool.
Affected Products
- Linux kernel branches containing the virt/sev-guest driver prior to the referenced stable fixes
- Systems running as AMD SEV / SEV-SNP guests using the sev-guest driver
- Stable kernel trees receiving backports via commits 3d0cd006, bee400ad, and fd948c3f
Discovery Timeline
- 2026-07-19 - CVE-2026-64104 published to NVD
- 2026-07-20 - Last updated in NVD database
Technical Details for CVE-2026-64104
Vulnerability Analysis
The sev-guest driver manages shared memory pages used for communication between an SEV guest and the hypervisor. To share memory, the driver flips pages between encrypted and decrypted states using set_memory_encrypted() and set_memory_decrypted(). These helpers walk kernel page tables and can fail partway through the transition. When they do, the driver has no reliable way to determine which pages, if any, were successfully re-encrypted before the failure.
The original code path freed these pages back to the buddy allocator regardless of the failure state. Because a subset of the pages may still be marked decrypted (shared with the hypervisor), any subsequent kernel allocation drawing from those pages would receive memory that lies outside the SEV encryption boundary. This breaks the isolation model that SEV is designed to enforce and can expose sensitive kernel or userspace data to the hypervisor.
Root Cause
The root cause is improper error handling around a partially-completed memory state transition, a variant of an inconsistent state issue. The driver assumed atomic success or clean rollback of set_memory_{encrypted,decrypted}(), which the API does not guarantee. Combined with unconditional page freeing on the error path, the pages entered general circulation in an unknown cryptographic state.
Attack Vector
Exploitation requires local access with low privileges inside an SEV guest, matching the CVSS local attack vector. A malicious or untrusted hypervisor, or a local actor able to trigger repeated failure conditions in the sev-guest driver, can force pages into the buddy allocator with mixed encrypted and decrypted mappings. Later allocations may then leak confidential guest data to the hypervisor or corrupt kernel state.
The fix, applied across the referenced stable commits, replaces the free-on-error path with a deliberate leak of the affected pages via snp_leak_pages(). This accounts for the pages as permanently withdrawn from allocation, preserving the SEV trust boundary at the cost of a bounded memory leak.
Detection Methods for CVE-2026-64104
Indicators of Compromise
- Kernel log entries from the sev-guest driver reporting failures from set_memory_encrypted() or set_memory_decrypted()
- Unexpected growth in leaked page accounting exposed by snp_leak_pages() in patched kernels
- Anomalous guest memory usage patterns on SEV-SNP hosts without corresponding workload growth
Detection Strategies
- Compare running kernel versions against the fixed commits 3d0cd0065deeb054b4b29236432e851806b7cc81, bee400ad4f4259c9c0758e4f1960a1eed6f6f9f0, and fd948c3f96b18ff9ba7d3e8eae13d196593e1aaf in the stable kernel tree
- Audit confidential computing workloads to confirm the sev-guest driver in use includes the leak-on-failure remediation
- Monitor dmesg for SEV, SNP, or set_memory_ error strings originating from guest kernels
Monitoring Recommendations
- Centralize kernel log collection from all SEV and SEV-SNP guest instances for retrospective analysis
- Alert on repeated set_memory_{encrypted,decrypted}() failures, which may indicate hypervisor-side manipulation
- Track kernel package versions across the confidential computing fleet to identify unpatched SEV guests
How to Mitigate CVE-2026-64104
Immediate Actions Required
- Apply the upstream Linux kernel patches referenced by commits 3d0cd006, bee400ad, and fd948c3f to all SEV and SEV-SNP guest images
- Rebuild or update guest kernel packages from your distribution once vendor backports are available
- Restart affected SEV guests after patching so the fixed sev-guest driver is loaded
Patch Information
The upstream fix modifies the sev-guest driver to never free pages when set_memory_encrypted() or set_memory_decrypted() returns an error. Instead it invokes snp_leak_pages() to account for the pages as permanently removed from allocation. The change is present in the three referenced kernel.org commits and will be picked up by long-term stable branches. Refer to Kernel Git Commit 1, Kernel Git Commit 2, and Kernel Git Commit 3.
Workarounds
- Restrict local low-privilege access inside SEV guests to reduce the ability to trigger driver error paths
- Limit workloads that repeatedly toggle page encryption state through the sev-guest interface until patched kernels are deployed
- Prefer trusted, attested hypervisor stacks to reduce the likelihood of induced set_memory_*() failures
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

