OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acd0578
)
KVM: SVM: do not allow VMRUN inside SMM
author
Paolo Bonzini
<pbonzini@redhat.com>
Thu, 23 Apr 2020 14:52:48 +0000
(10:52 -0400)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Fri, 24 Apr 2020 16:53:18 +0000
(12:53 -0400)
VMRUN is not supported inside the SMM handler and the behavior is undefined.
Just raise a #UD.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c
patch
|
blob
|
history
diff --git
a/arch/x86/kvm/svm/nested.c
b/arch/x86/kvm/svm/nested.c
index
6ea047e
..
a7c3b30
100644
(file)
--- a/
arch/x86/kvm/svm/nested.c
+++ b/
arch/x86/kvm/svm/nested.c
@@
-345,8
+345,12
@@
int nested_svm_vmrun(struct vcpu_svm *svm)
struct kvm_host_map map;
u64 vmcb_gpa;
- vmcb_gpa = svm->vmcb->save.rax;
+ if (is_smm(&svm->vcpu)) {
+ kvm_queue_exception(&svm->vcpu, UD_VECTOR);
+ return 1;
+ }
+ vmcb_gpa = svm->vmcb->save.rax;
ret = kvm_vcpu_map(&svm->vcpu, gpa_to_gfn(vmcb_gpa), &map);
if (ret == -EINVAL) {
kvm_inject_gp(&svm->vcpu, 0);