Blame 0003-qxl-check-release-info-object.patch

8a7ac9
From: Prasad J Pandit <pjp@fedoraproject.org>
8a7ac9
Date: Thu, 25 Apr 2019 12:05:34 +0530
8a7ac9
Subject: [PATCH] qxl: check release info object
8a7ac9
8a7ac9
When releasing spice resources in release_resource() routine,
8a7ac9
if release info object 'ext.info' is null, it leads to null
8a7ac9
pointer dereference. Add check to avoid it.
8a7ac9
8a7ac9
Reported-by: Bugs SysSec <bugs-syssec@rub.de>
8a7ac9
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
8a7ac9
Message-id: 20190425063534.32747-1-ppandit@redhat.com
8a7ac9
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
8a7ac9
(cherry picked from commit d52680fc932efb8a2f334cc6993e705ed1e31e99)
8a7ac9
---
8a7ac9
 hw/display/qxl.c | 3 +++
8a7ac9
 1 file changed, 3 insertions(+)
8a7ac9
8a7ac9
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
8a7ac9
index c8ce5781e0..632923add2 100644
8a7ac9
--- a/hw/display/qxl.c
8a7ac9
+++ b/hw/display/qxl.c
8a7ac9
@@ -777,6 +777,9 @@ static void interface_release_resource(QXLInstance *sin,
8a7ac9
     QXLReleaseRing *ring;
8a7ac9
     uint64_t *item, id;
8a7ac9
 
8a7ac9
+    if (!ext.info) {
8a7ac9
+        return;
8a7ac9
+    }
8a7ac9
     if (ext.group_id == MEMSLOT_GROUP_HOST) {
8a7ac9
         /* host group -> vga mode update request */
8a7ac9
         QXLCommandExt *cmdext = (void *)(intptr_t)(ext.info->id);