Executive brief
The Linux kernel's KVM hypervisor implementation contains a race condition in AMD SEV (Secure Encrypted Virtualization) mirror context handling. Attackers exploiting concurrent VM operations could corrupt internal kernel data structures or cause incorrect reference counting, potentially leading to use-after-free and system instability or denial of service.
Technical details
The vulnerability exists in the KVM SVM subsystem's handling of encrypted VM context migration and mirroring via KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM and KVM_CAP_VM_COPY_ENC_CONTEXT_FROM capabilities. Two race conditions are present: (1) in sev_migrate_from(), when moving a mirror entry from the source VM's list to the owner's mirror_vms list, the owner's lock is not held, allowing concurrent COPY or destroy operations to corrupt the list; (2) in sev_vm_destroy(), the owner VM pointer may change concurrently, causing kvm_put_kvm() to be called on the wrong VM reference. The fix adds a global mutex (sev_mirror_lock) to serialize access to enc_context_owner, mirror_vms, and mirror_entry. The vulnerability affects the kernel's SVM/SEV code path and requires local access to the hypervisor (typically via QEMU or libvirt) to trigger. A patch was merged by Paolo Bonzini on 2026-08-06 and backported to stable branches.
Affected products
- Linux Linux Kernel 5.16 through 6.x (affected versions include KVM/SVM code after commit b2125513dfc0)
Timeline
- 2026-08-22: disclosed
- 2026-08-06: patched: Fix merged upstream by Paolo Bonzini; backported to stable branches as of 2026-08-23
- 2026-08-06: other: Reported by Shen Yongchao