]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
KVM: SVM: Zero out the VMCB array used to track SEV ASID association
authorSean Christopherson <seanjc@google.com>
Thu, 22 Apr 2021 02:11:11 +0000 (19:11 -0700)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:43 +0000 (17:46 -0600)
commitcb2797dfdb8fd253e4e397a4b409cd07b113ae0d
tree26737bf7d9d940a3d617370252bf0e8b8ea8f8d2
parent200705dfe555eb8e0fd2f7348d1e52b167a5c7a0
KVM: SVM: Zero out the VMCB array used to track SEV ASID association

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 3b1902b87bf11f1c6a84368470dc13da6f3da3bd ]

Zero out the array of VMCB pointers so that pre_sev_run() won't see
garbage when querying the array to detect when an SEV ASID is being
associated with a new VMCB.  In practice, reading random values is all
but guaranteed to be benign as a false negative (which is extremely
unlikely on its own) can only happen on CPU0 on the first VMRUN and would
only cause KVM to skip the ASID flush.  For anything bad to happen, a
previous instance of KVM would have to exit without flushing the ASID,
_and_ KVM would have to not flush the ASID at any time while building the
new SEV guest.

Cc: Borislav Petkov <bp@suse.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Fixes: 70cd94e60c73 ("KVM: SVM: VMRUN should use associated ASID when SEV is enabled")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210422021125.3417167-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/x86/kvm/svm/svm.c