KVM: VMX: Check cpl before emulating debug register access
Debug registers may only be accessed from cpl 0. Unfortunately, vmx will code to emulate the instruction even though it was issued from guest userspace, possibly leading to an unexpected trap later. Cc: stable@kernel.org Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
@@ -2934,6 +2934,8 @@ static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
||||
unsigned long val;
|
||||
int dr, reg;
|
||||
|
||||
if (!kvm_require_cpl(vcpu, 0))
|
||||
return 1;
|
||||
dr = vmcs_readl(GUEST_DR7);
|
||||
if (dr & DR7_GD) {
|
||||
/*
|
||||
|
مرجع در شماره جدید
Block a user