]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: sev: Fail KVM_SEV_INIT if already initialized
authorDavid Rientjes <rientjes@google.com>
Wed, 2 Jan 2019 20:56:33 +0000 (12:56 -0800)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 11 Jan 2019 17:38:07 +0000 (18:38 +0100)
commit7ee0dd8aa821c56d4df8af6d4e735c858ff11f25
tree402821c7e8ea3a766a4d43750c8cd1d5ccb69c3d
parentfe4cdf0ec18827a284bd7839a65a945e6cb63b0f
kvm: sev: Fail KVM_SEV_INIT if already initialized

By code inspection, it was found that multiple calls to KVM_SEV_INIT
could deplete asid bits and overwrite kvm_sev_info's regions_list.

Multiple calls to KVM_SVM_INIT is not likely to occur with QEMU, but this
should likely be fixed anyway.

This code is serialized by kvm->lock.

Fixes: 527390bcc2f8 ("KVM: SVM: Add KVM_SEV_INIT command")
Reported-by: Cfir Cohen <cfir@google.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/svm.c