Skip to content

Commit 2b347a3

Browse files
committed
KVM: SEV: initialize regions_list of a mirror VM
This was broken before the introduction of KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM, but technically harmless because the region list was unused for a mirror VM. However, it is untidy and it now causes a NULL pointer access when attempting to move the encryption context of a mirror VM. Fixes: 54526d1 ("KVM: x86: Support KVM VMs sharing SEV context") Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 501b580 commit 2b347a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,7 @@ int svm_vm_copy_asid_from(struct kvm *kvm, unsigned int source_fd)
20072007
mirror_sev->fd = source_sev.fd;
20082008
mirror_sev->es_active = source_sev.es_active;
20092009
mirror_sev->handle = source_sev.handle;
2010+
INIT_LIST_HEAD(&mirror_sev->regions_list);
20102011
/*
20112012
* Do not copy ap_jump_table. Since the mirror does not share the same
20122013
* KVM contexts as the original, and they may have different

0 commit comments

Comments
 (0)