yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 1fd91c62715b21e480a8c25d05452acb633ab11c Mon Sep 17 00:00:00 2001
9ae3a8
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com>
9ae3a8
Date: Wed, 19 Jun 2019 16:03:38 +0200
9ae3a8
Subject: [PATCH 1/4] qxl: check release info object
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
RH-Author: Philippe Mathieu-Daudé <philmd@redhat.com>
9ae3a8
Message-id: <20190619160338.15430-2-philmd@redhat.com>
9ae3a8
Patchwork-id: 88733
9ae3a8
O-Subject: [RHEL-7.7 qemu-kvm PATCH 1/1] qxl: check release info object
9ae3a8
Bugzilla: 1712703
9ae3a8
RH-Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
9ae3a8
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
From: Prasad J Pandit <pjp@fedoraproject.org>
9ae3a8
9ae3a8
When releasing spice resources in release_resource() routine,
9ae3a8
if release info object 'ext.info' is null, it leads to null
9ae3a8
pointer dereference. Add check to avoid it.
9ae3a8
9ae3a8
Reported-by: Bugs SysSec <bugs-syssec@rub.de>
9ae3a8
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
9ae3a8
Message-id: 20190425063534.32747-1-ppandit@redhat.com
9ae3a8
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9ae3a8
(cherry picked from commit d52680fc932efb8a2f334cc6993e705ed1e31e99)
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/display/qxl.c | 3 +++
9ae3a8
 1 file changed, 3 insertions(+)
9ae3a8
9ae3a8
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
9ae3a8
index 0625a76..d493101 100644
9ae3a8
--- a/hw/display/qxl.c
9ae3a8
+++ b/hw/display/qxl.c
9ae3a8
@@ -735,6 +735,9 @@ static void interface_release_resource(QXLInstance *sin,
9ae3a8
     QXLReleaseRing *ring;
9ae3a8
     uint64_t *item, id;
9ae3a8
 
9ae3a8
+    if (!ext.info) {
9ae3a8
+        return;
9ae3a8
+    }
9ae3a8
     if (ext.group_id == MEMSLOT_GROUP_HOST) {
9ae3a8
         /* host group -> vga mode update request */
9ae3a8
         qemu_spice_destroy_update(&qxl->ssd, (void *)(intptr_t)ext.info->id);
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8