CVE-2026-98718: KVM: SEV: Do cache maintenance on the source VM *before* clearing SEV state
In the Linux kernel, the following vulnerability has been resolved:
KVM: SEV: Do cache maintenance on the source VM before clearing SEV state
Explicitly flush caches after intra-host migration before clearing "SEV active" on the source VM, as doing cache maintenance afterwards creates a tiny window where memory reclaim could return memory to the host without performing a cache flush, e.g. as pointed out by Sashiko:
CPU1 in sevmigratefrom(): src->active = false;
CPU2 running concurrent unmap: Since active is false, the automatic cache flush in sevguestmemoryreclaimed is skipped. The host frees and reallocates the page.
CPU1 in sevmigratefrom(): sevwritebackcaches(srckvm); Executes a hardware cache flush (wbnoinvd), which writes the guest's old dirty ciphertext over the new page owner's data.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
During intra-host SEV migration, perform cache maintenance with sev_writeback_caches(src_kvm) before clearing the source VM's SEV state (before setting src->active = false).
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Linux kernel systems using KVM with SEV are exposed during an intra-host migration of an SEV guest. The race involves the source VM and concurrent guest-memory unmapping or reclaim.
What conditions trigger the unsafe behavior?
The source VM's SEV active state must be cleared before its cache maintenance completes, while another CPU concurrently reclaims guest memory. The reclaimed page can be returned to the host and reallocated before the delayed hardware cache flush runs.
What is the potential impact of a successful race?
The later cache flush can write the guest's old dirty ciphertext over data belonging to the page's new owner. This can corrupt the newly allocated page's data.