cirrus: don't overflow CirrusVGAState->cirrus_bltbuf
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 19 Nov 2014 12:27:28 +0000 (13:27 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 1 Dec 2014 09:25:46 +0000 (10:25 +0100)
This is CVE-2014-8106.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/cirrus_vga.c

index d54fb064615447e9b49755013340646a44c891c1..27252646bc7817aa8b79c4fd2042769f6627b7cc 100644 (file)
@@ -293,6 +293,10 @@ static bool blit_is_unsafe(struct CirrusVGAState *s)
     assert(s->cirrus_blt_width > 0);
     assert(s->cirrus_blt_height > 0);
 
+    if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) {
+        return true;
+    }
+
     if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch,
                               s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) {
         return true;