spice: fix invalid memory access to vga.vram
commit876d516311c1538a7d29f2abec48b7cda0645eea
authorRadim Krčmář <rkrcmar@redhat.com>
Tue, 17 Feb 2015 16:30:51 +0000 (17 17:30 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 3 Mar 2015 07:33:08 +0000 (3 08:33 +0100)
tree5b3ff196cabf460f9ae287031430359c4effd8dd
parent03d9825d15e17e444e00bd4caa9edb0d57022794
spice: fix invalid memory access to vga.vram

vga_common_init() doesn't allow more than 256 MiB vram size and silently
shrinks any larger value.  qxl_dirty_surfaces() used the unshrinked size
via qxl->shadow_rom.surface0_area_size when accessing the memory, which
resulted in segfault.

Add a workaround for this case and an assert if it happens again.

We have to bump the vga memory limit too, because 256 MiB wouldn't have
allowed 8k (it requires more than 128 MiB).
1024 MiB doesn't work, but 512 MiB seems fine.

Proposed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/qxl.c
hw/display/vga.c