Blame 0401-qxl-Slot-sanity-check-in-qxl_phys2virt-is-off-by-one.patch
|
Hans de Goede |
56753f |
From 8858b6d0dac346d9f841cfa84f57cb03bffdf050 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
56753f |
From: Markus Armbruster <armbru@redhat.com>
|
|
Hans de Goede |
56753f |
Date: Fri, 4 Nov 2011 10:34:24 +0100
|
|
Hans de Goede |
56753f |
Subject: [PATCH 401/434] qxl: Slot sanity check in qxl_phys2virt() is off by
|
|
Hans de Goede |
56753f |
one, fix
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Spotted by Coverity.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
Hans de Goede |
56753f |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
56753f |
---
|
|
Hans de Goede |
56753f |
hw/qxl.c | 2 +-
|
|
Hans de Goede |
56753f |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
diff --git a/hw/qxl.c b/hw/qxl.c
|
|
Hans de Goede |
56753f |
index 41500e9..e0f9d4a 100644
|
|
Hans de Goede |
56753f |
--- a/hw/qxl.c
|
|
Hans de Goede |
56753f |
+++ b/hw/qxl.c
|
|
Hans de Goede |
56753f |
@@ -1020,7 +1020,7 @@ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
|
|
Hans de Goede |
56753f |
case MEMSLOT_GROUP_HOST:
|
|
Hans de Goede |
56753f |
return (void*)offset;
|
|
Hans de Goede |
56753f |
case MEMSLOT_GROUP_GUEST:
|
|
Hans de Goede |
56753f |
- PANIC_ON(slot > NUM_MEMSLOTS);
|
|
Hans de Goede |
56753f |
+ PANIC_ON(slot >= NUM_MEMSLOTS);
|
|
Hans de Goede |
56753f |
PANIC_ON(!qxl->guest_slots[slot].active);
|
|
Hans de Goede |
56753f |
PANIC_ON(offset < qxl->guest_slots[slot].delta);
|
|
Hans de Goede |
56753f |
offset -= qxl->guest_slots[slot].delta;
|
|
Hans de Goede |
56753f |
--
|
|
Hans de Goede |
56753f |
1.7.10
|
|
Hans de Goede |
56753f |
|