]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
x86/HVM: return all ones on wrong-sized reads of system device I/O ports
authorJan Beulich <jbeulich@suse.com>
Thu, 5 Mar 2015 12:34:54 +0000 (13:34 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Mar 2015 12:34:54 +0000 (13:34 +0100)
So far the value presented to the guest remained uninitialized.

This is CVE-2015-2044 / XSA-121.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/x86/hvm/i8254.c
xen/arch/x86/hvm/pmtimer.c
xen/arch/x86/hvm/rtc.c
xen/arch/x86/hvm/vpic.c

index 3ec01c0a1367953ee6c0d2d3cc6bcad697ab8ad7..36a0a53a2ed71ecda86200edbb50acc18cb9df6f 100644 (file)
@@ -486,6 +486,7 @@ static int handle_pit_io(
     if ( bytes != 1 )
     {
         gdprintk(XENLOG_WARNING, "PIT bad access\n");
+        *val = ~0;
         return X86EMUL_OKAY;
     }
 
index 01ae31d38dde1b9b6e321bb6cf58cd78d559d1a4..6ad279798654539941bcf73eb09656970fbfb2c7 100644 (file)
@@ -213,6 +213,7 @@ static int handle_pmt_io(
     if ( bytes != 4 )
     {
         gdprintk(XENLOG_WARNING, "HVM_PMT bad access\n");
+        *val = ~0;
         return X86EMUL_OKAY;
     }
     
index 3fab660a7d26a0967d473ed5103f8562c44c2da6..3448971d28a3b83f0c5f8cb512c92b124089902d 100644 (file)
@@ -703,7 +703,8 @@ static int handle_rtc_io(
 
     if ( bytes != 1 )
     {
-        gdprintk(XENLOG_WARNING, "HVM_RTC bas access\n");
+        gdprintk(XENLOG_WARNING, "HVM_RTC bad access\n");
+        *val = ~0;
         return X86EMUL_OKAY;
     }
     
index d72b6ff3fa625685f5cb22aabaee3968407b7d73..8eea0611de245615e4499ace7f5b0813564a0b27 100644 (file)
@@ -331,6 +331,7 @@ static int vpic_intercept_pic_io(
     if ( bytes != 1 )
     {
         gdprintk(XENLOG_WARNING, "PIC_IO bad access size %d\n", bytes);
+        *val = ~0;
         return X86EMUL_OKAY;
     }