[PATCH v2 2/2] KVM: Inject #GP on invalid writes to x2APIC registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Orr <marcorr@xxxxxxxxxx>

From: Venkatesh Srinivas <venkateshs@xxxxxxxxxxxx>

The upper bytes of any x2APIC register are reserved. Inject a #GP
into the guest if any of these reserved bits are set.

Signed-off-by: Marc Orr <marcorr@xxxxxxxxxx>
Signed-off-by: Venkatesh Srinivas <venkateshs@xxxxxxxxxxxx>
---
 arch/x86/kvm/lapic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 6f8522e8c492..617e4936c5cc 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2907,6 +2907,8 @@ int kvm_x2apic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data)
 
 	if (!lapic_in_kernel(vcpu) || !apic_x2apic_mode(apic))
 		return 1;
+	else if (data >> 32)
+		return 1;
 
 	return kvm_lapic_msr_write(apic, reg, data);
 }
-- 
2.36.1.124.g0e6072fb45-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux