diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-08-28 14:33:07 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-09-01 13:52:43 +0200 |
commit | e65294157d4b69393b3f819c99f4f647452b48e3 (patch) | |
tree | 9dd6b9411cd4b4d4eea14a7ca17b46a644c75d57 /hw/display/vga.c | |
parent | 223cd0e13f2e46078d7b573f0b8402bfbee339be (diff) |
vga: fix display update region calculation (split screen)
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 <ppandit@redhat.com>
Reported-by: David Buchanan <d@vidbuchanan.co.uk>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20170828123307.15392-1-kraxel@redhat.com
Diffstat (limited to 'hw/display/vga.c')
-rw-r--r-- | hw/display/vga.c | 10 |
1 files 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); } |