From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnlWB-0001x1-6i for qemu-devel@nongnu.org; Fri, 01 Sep 2017 08:57:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnlW6-0007oi-DK for qemu-devel@nongnu.org; Fri, 01 Sep 2017 08:57:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dnlW6-0007oI-77 for qemu-devel@nongnu.org; Fri, 01 Sep 2017 08:57:46 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E8A44E4C2 for ; Fri, 1 Sep 2017 12:57:45 +0000 (UTC) From: Gerd Hoffmann Date: Fri, 1 Sep 2017 14:57:38 +0200 Message-Id: <20170901125742.4249-2-kraxel@redhat.com> In-Reply-To: <20170901125742.4249-1-kraxel@redhat.com> References: <20170901125742.4249-1-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 1/5] vga: fix display update region calculation (split screen) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , P J P vga display update mis-calculated the region for the dirty bitmap snapshot in case split screen mode is used. This can trigger an assert in cpu_physical_memory_snapshot_get_dirty(). Impact: DoS for privileged guest users. Fixes: CVE-2017-13673 Fixes: fec5e8c92becad223df9d972770522f64aafdb72 Cc: P J P Reported-by: David Buchanan Signed-off-by: Gerd Hoffmann Message-id: 20170828123307.15392-1-kraxel@redhat.com --- hw/display/vga.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 3433102ef3..ad7a46563c 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1628,9 +1628,15 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) y1 = 0; if (!full_update) { + ram_addr_t region_start = addr1; + ram_addr_t region_end = addr1 + line_offset * height; vga_sync_dirty_bitmap(s); - snap = memory_region_snapshot_and_clear_dirty(&s->vram, addr1, - line_offset * height, + if (s->line_compare < height) { + /* split screen mode */ + region_start = 0; + } + snap = memory_region_snapshot_and_clear_dirty(&s->vram, region_start, + region_end - region_start, DIRTY_MEMORY_VGA); } -- 2.9.3