808b049
x86/HVM: properly bound x2APIC MSR range
808b049
808b049
While the write path change appears to be purely cosmetic (but still
808b049
gets done here for consistency), the read side mistake permitted
808b049
accesses beyond the virtual APIC page.
808b049
808b049
Note that while this isn't fully in line with the specification
808b049
(digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
808b049
possible fix addressing the security issue and getting x2APIC related
808b049
code into a consistent shape (elsewhere a 256 rather than 1024 wide
808b049
window is being used too). This will be dealt with subsequently.
808b049
808b049
This is XSA-108.
808b049
808b049
Signed-off-by: Jan Beulich <jbeulich@suse.com>
808b049
808b049
--- a/xen/arch/x86/hvm/hvm.c
808b049
+++ b/xen/arch/x86/hvm/hvm.c
808b049
@@ -4380,7 +4380,7 @@ int hvm_msr_read_intercept(unsigned int 
808b049
         *msr_content = vcpu_vlapic(v)->hw.apic_base_msr;
808b049
         break;
808b049
 
808b049
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
808b049
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
808b049
         if ( hvm_x2apic_msr_read(v, msr, msr_content) )
808b049
             goto gp_fault;
808b049
         break;
808b049
@@ -4506,7 +4506,7 @@ int hvm_msr_write_intercept(unsigned int
808b049
         vlapic_tdt_msr_set(vcpu_vlapic(v), msr_content);
808b049
         break;
808b049
 
808b049
-    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0x3ff:
808b049
+    case MSR_IA32_APICBASE_MSR ... MSR_IA32_APICBASE_MSR + 0xff:
808b049
         if ( hvm_x2apic_msr_write(v, msr, msr_content) )
808b049
             goto gp_fault;
808b049
         break;