[Pkg-xen-changes] [xen] 02/08: xen/arm: vgic: message in the emulation code should be rate-limited

Bastian Blank waldi at moszumanska.debian.org
Sun Mar 1 20:32:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

waldi pushed a commit to branch debian/jessie
in repository xen.

commit dd6514afbfc96f53c7d73df3f4dcaec875ca934e
Author: Julien Grall <julien.grall at linaro.org>
Date:   Mon Jan 19 12:59:42 2015 +0000

    xen/arm: vgic: message in the emulation code should be rate-limited
    
    printk is not rated-limited by default. Therefore a malicious guest may
    be able to flood the Xen console.
    
    If we use gdprintk, unecessary information will be printed such as the
    filename and the line. Instead use XENLOG_G_ERR combine with %pv.
    
    This is XSA-118.
    
    Signed-off-by: Julien Grall <julien.grall at linaro.org>
    Acked-by: Ian Campbell <ian.campbell at citrix.com>
    [ relates to d0b2caa80fccafbb131b28b7b8488001d82ab4bf in master ]
    
    (cherry picked from commit cc05e029d1ba7772ca3fd45bbcee081f527089f5)
    
    Patch-Name: CVE-2015-1563.diff
---
 xen/arch/arm/vgic.c | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 850006c..80b2822 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -335,7 +335,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPIDR2:
         if ( dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled read from ICPIDR2\n");
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read from ICPIDR2\n", v);
         return 0;
 
     /* Implementation defined -- read as zero */
@@ -352,14 +352,14 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         goto read_as_zero;
 
     default:
-        printk("vGICD: unhandled read r%d offset %#08x\n",
-               dabt.reg, offset);
+        printk(XENLOG_G_ERR "%pv: vGICD: unhandled read r%d offset %#08x\n",
+               v, dabt.reg, offset);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad read width %d r%d offset %#08x\n",
-           dabt.size, dabt.reg, offset);
+    printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n",
+           v, dabt.size, dabt.reg, offset);
     domain_crash_synchronous();
     return 0;
 
@@ -526,14 +526,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ISPENDR);
         return 0;
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_ICPENDR);
         return 0;
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
@@ -609,14 +611,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ICPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_CPENDSGIR);
         return 0;
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        printk("vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
-               dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled %s write %#"PRIregister" to ISPENDSGIR%d\n",
+               v, dabt.size ? "word" : "byte", *r, gicd_reg - GICD_SPENDSGIR);
         return 0;
 
     /* Implementation defined -- write ignored */
@@ -641,14 +645,16 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     default:
-        printk("vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
-               dabt.reg, *r, offset);
+        printk(XENLOG_G_ERR
+               "%pv: vGICD: unhandled write r%d=%"PRIregister" offset %#08x\n",
+               v, dabt.reg, *r, offset);
         return 0;
     }
 
 bad_width:
-    printk("vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
-           dabt.size, dabt.reg, *r, offset);
+    printk(XENLOG_G_ERR
+           "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n",
+           v, dabt.size, dabt.reg, *r, offset);
     domain_crash_synchronous();
     return 0;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xen/xen.git



More information about the Pkg-xen-changes mailing list