mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
kvm: nVMX: Fix fault vector for VMX operation at CPL > 0
[ Upstream commit36090bf43a] The fault that should be raised for a privilege level violation is #GP rather than #UD. Fixes:727ba748e1("kvm: nVMX: Enforce cpl=0 for VMX instructions") Signed-off-by: Jim Mattson <jmattson@google.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1187e0186d
commit
80f97c79f3
@@ -7590,7 +7590,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
|
||||
|
||||
/* CPL=0 must be checked manually. */
|
||||
if (vmx_get_cpl(vcpu)) {
|
||||
kvm_queue_exception(vcpu, UD_VECTOR);
|
||||
kvm_inject_gp(vcpu, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -7654,7 +7654,7 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
|
||||
static int nested_vmx_check_permission(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
if (vmx_get_cpl(vcpu)) {
|
||||
kvm_queue_exception(vcpu, UD_VECTOR);
|
||||
kvm_inject_gp(vcpu, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user