aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2022-11-28 21:27:41 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2022-11-29 18:15:26 -0500
commit86fdb0582c653a9824183679403a85f588260d62 (patch)
treee9fd4e0489a7748b6b512833fc041cdef605966e /hw/display
parent6dbbf055148c6f1b7d8a3251a65bd6f3d1e1f622 (diff)
downloadqemu-86fdb0582c653a9824183679403a85f588260d62.zip
qemu-86fdb0582c653a9824183679403a85f588260d62.tar.gz
qemu-86fdb0582c653a9824183679403a85f588260d62.tar.bz2
hw/display/qxl: Assert memory slot fits in preallocated MemoryRegion
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20221128202741.4945-6-philmd@linaro.org>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/qxl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 0b21626..6772849 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1384,6 +1384,7 @@ static int qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
qxl_set_guest_bug(d, "%s: pci_region = %d", __func__, pci_region);
return 1;
}
+ assert(guest_end - pci_start <= memory_region_size(mr));
virt_start = (intptr_t)memory_region_get_ram_ptr(mr);
memslot.slot_id = slot_id;