Skip to content

Commit 3dc5666

Browse files
Maxim Levitskygregkh
authored andcommitted
KVM: nSVM: always intercept VMLOAD/VMSAVE when nested (CVE-2021-3656)
commit c7dfa40 upstream. If L1 disables VMLOAD/VMSAVE intercepts, and doesn't enable Virtual VMLOAD/VMSAVE (currently not supported for the nested hypervisor), then VMLOAD/VMSAVE must operate on the L1 physical memory, which is only possible by making L0 intercept these instructions. Failure to do so allowed the nested guest to run VMLOAD/VMSAVE unintercepted, and thus read/write portions of the host physical memory. Fixes: 89c8a49 ("KVM: SVM: Enable Virtual VMLOAD VMSAVE feature") Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c0883f6 commit 3dc5666

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/kvm/svm/nested.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ void recalc_intercepts(struct vcpu_svm *svm)
147147

148148
for (i = 0; i < MAX_INTERCEPT; i++)
149149
c->intercepts[i] |= g->intercepts[i];
150+
151+
vmcb_set_intercept(c, INTERCEPT_VMLOAD);
152+
vmcb_set_intercept(c, INTERCEPT_VMSAVE);
150153
}
151154

152155
static void copy_vmcb_control_area(struct vmcb_control_area *dst,

0 commit comments

Comments
 (0)