]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SEV: Lock all vCPUs when synchronzing VMSAs for SNP launch finish
authorSean Christopherson <seanjc@google.com>
Tue, 10 Mar 2026 23:48:13 +0000 (16:48 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 8 Apr 2026 23:04:19 +0000 (16:04 -0700)
commitcb923ee6a80f4e604e6242a4702b59251e61a380
treeb319ea0e6c635b63338ce9982070885b519871a7
parent624bf3440d7214b62c22d698a0a294323f331d5d
KVM: SEV: Lock all vCPUs when synchronzing VMSAs for SNP launch finish

Lock all vCPUs when synchronizing and encrypting VMSAs for SNP guests, as
allowing userspace to manipulate and/or run a vCPU while its state is being
synchronized would at best corrupt vCPU state, and at worst crash the host
kernel.

Opportunistically assert that vcpu->mutex is held when synchronizing its
VMSA (the SEV-ES path already locks vCPUs).

Fixes: ad27ce155566 ("KVM: SEV: Add KVM_SEV_SNP_LAUNCH_FINISH command")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260310234829.2608037-6-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c