x86: KVM: svm: Fix a check in nested_svm_vmrun()
Subsystems (4)
PATCH 1/1 x86: KVM: svm: Fix a check in nested_svm_vmrun()
We refactored this code a bit and accidentally deleted the "-" character from "-EINVAL". The kvm_vcpu_map() function never returns positive EINVAL.
---
From static analysis. I don't really know the impact.
arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/svm.c +1 -1
@@ -3598,7 +3598,7 @@ static int nested_svm_vmrun(struct vcpu_svm *svm) vmcb_gpa = svm->vmcb->save.rax; ret =kvm_vcpu_map (&svm->vcpu,gpa_to_gfn (vmcb_gpa), &map); -if (ret =EINVAL ) { +if (ret = -EINVAL ) {kvm_inject_gp (&svm->vcpu,0 );return 1 ; }else if (ret) {
Signature · 1 line
2.20.1
Quoted 18 lines · Dan Carpenter
We refactored this code a bit and accidentally deleted the "-" character from "
-EINVAL". Thekvm_vcpu_map()function never returns positive EINVAL.Fixes c8e16b78c614 ("x86: KVM: svm: eliminate hardcoded RIP advancement from vmrun_interception()")Signed-off-by Dan Carpenter <[email protected]>---
From static analysis. I don't really know the impact.arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/svm.c +0
-0
arch/x86/kvm/svm.c static int nested_svm_vmrun(struct vcpu_svm *svm) · line 3604
Quoted 8 lines
arch/x86/kvm/svm.c +1
-1@@ -3598,7 +3598,7 @@ static int nested_svm_vmrun(struct vcpu_svm *svm) vmcb_gpa = svm->vmcb->save.rax; ret =kvm_vcpu_map (&svm->vcpu,gpa_to_gfn (vmcb_gpa), &map); -if (ret =EINVAL ) { +if (ret = -EINVAL ) {kvm_inject_gp (&svm->vcpu,0 );return 1 ; }else if (ret) {
I was hoping that my patch was OK and Paolo screwed it upon commit but no, it's the same in my local branch and I'm left without excuses :-)
Signature · 1 line
Vitaly
Quoted 7 lines · Dan Carpenter
We refactored this code a bit and accidentally deleted the "-" character from "
-EINVAL". Thekvm_vcpu_map()function never returns positive EINVAL.Fixes c8e16b78c614 ("x86: KVM: svm: eliminate hardcoded RIP advancement from vmrun_interception()")Signed-off-by Dan Carpenter <[email protected]>---
Quoted 19 lines · Dan Carpenter
We refactored this code a bit and accidentally deleted the "-" character from "
-EINVAL". Thekvm_vcpu_map()function never returns positive EINVAL.Fixes c8e16b78c614 ("x86: KVM: svm: eliminate hardcoded RIP advancement from vmrun_interception()")Signed-off-by Dan Carpenter <[email protected]>---
From static analysis. I don't really know the impact.arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kvm/svm.c +0
-0
arch/x86/kvm/svm.c static int nested_svm_vmrun(struct vcpu_svm *svm) · line 3604
Quoted 8 lines
arch/x86/kvm/svm.c +1
-1@@ -3598,7 +3598,7 @@ static int nested_svm_vmrun(struct vcpu_svm *svm) vmcb_gpa = svm->vmcb->save.rax; ret =kvm_vcpu_map (&svm->vcpu,gpa_to_gfn (vmcb_gpa), &map); -if (ret =EINVAL ) { +if (ret = -EINVAL ) {kvm_inject_gp (&svm->vcpu,0 );return 1 ; }else if (ret) {
Queued, thanks.
Paolo