From nobody Mon Nov 10 11:19:28 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556174737; cv=none; d=zoho.com; s=zohoarc; b=OSydfl208PQdurd+PRxbTScekzeFwolvsmRryT0jNfEFA8mkC1pdb1WQX6WPnwYlOlXHybWIn6UFU5V91Qx9nkhQduXETs2WZomD6bbc/my3KWdUec4KM9qXETVaxsWnYQJ7PBJd5MKsjSVdEggRbcRj2ICAH7AxXO3qJMKZ+1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556174737; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=6LPPBl3mLMv7mQwhvgaR3UUwPDXlfO6S7JsOhJKYQk0=; b=Kf/Im6zt8U+kGgn+MA4i/a9yPJEoqjVjawwQMJ1RqSRBRASNMBgkuBgSpVpVFBU7CczQi8iIoY/DXCDwMJw9SKX18F5wek4YfziB4llcWNannjtRCTMAclz+Hq9xuN0WEk09NTMQYRYw/OPAondukrJ8pfualuFo2NC2B4URiWw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556174736968486.1056855202096; Wed, 24 Apr 2019 23:45:36 -0700 (PDT) Received: from localhost ([127.0.0.1]:52775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJY8T-00067E-KZ for importer@patchew.org; Thu, 25 Apr 2019 02:45:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJY6N-0004js-Q2 for qemu-devel@nongnu.org; Thu, 25 Apr 2019 02:43:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJXyy-0004aj-L6 for qemu-devel@nongnu.org; Thu, 25 Apr 2019 02:35:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJXyy-0004YT-Ez for qemu-devel@nongnu.org; Thu, 25 Apr 2019 02:35:44 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78585C057F3B; Thu, 25 Apr 2019 06:35:41 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-47.phx2.redhat.com [10.3.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 843055D9C5; Thu, 25 Apr 2019 06:35:37 +0000 (UTC) From: P J P To: QEMU Developers Date: Thu, 25 Apr 2019 12:05:34 +0530 Message-Id: <20190425063534.32747-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 25 Apr 2019 06:35:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qxl: check release info object X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bugs SysSec , Gerd Hoffmann , Prasad J Pandit Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit When releasing spice resources in release_resource() routine, if release info object 'ext.info' is null, it leads to null pointer dereference. Add check to avoid it. Reported-by: Bugs SysSec Signed-off-by: Prasad J Pandit --- hw/display/qxl.c | 3 +++ 1 file changed, 3 insertions(+) =3D=3D=3D (process:30785): Spice-WARNING **: 11:43:59.284: memslot.c:68:memslot_valid= ate_virt: virtual address out of range virt=3D0x555556d247e0+0xbf slot_id=3D0 group_id=3D0 slot=3D0x0-0x0 delta=3D0x0 Thread 5 "SPICE Worker" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffdb7ff700 (LWP 30792)] interface_release_resource (sin=3D0x555556d12738, ext=3D...) at hw/display/= qxl.c:785 785 QXLCommandExt *cmdext =3D (void *)(intptr_t)(ext.info->id); (gdb) bt #0 0x0000555555adca68 in interface_release_resource (sin=3D0x555556d12738,= ext=3D...) at hw/display/qxl.c:785 #1 0x00007ffff74991d5 in red_drawable_unref (red_drawable=3D0x7fffd402a520= ) at red-worker.c:100 #2 0x00007ffff749941c in red_drawable_unref (red_drawable=3D) at red-worker.c:229 #3 0x00007ffff749941c in red_process_display (worker=3Dworker@entry=3D0x55= 5556e2f050, ring_is_empty=3Dring_is_empty@entry=3D0x7fffdb7fe854) at red-wo= rker.c:229 #4 0x00007ffff74995f2 in worker_source_dispatch (source=3D,= callback=3D, user_data=3D) at red-worker.c:1= 265 #5 0x00007ffff7ec906d in g_main_dispatch (context=3D0x555556e38fc0) at gma= in.c:3182 #6 0x00007ffff7ec906d in g_main_context_dispatch (context=3Dcontext@entry= =3D0x555556e38fc0) at gmain.c:3847 #7 0x00007ffff7ec9438 in g_main_context_iterate (context=3D0x555556e38fc0,= block=3Dblock@entry=3D1, dispatch=3Ddispatch@entry=3D1, self=3D) at gmain.c:3920 #8 0x00007ffff7ec9762 in g_main_loop_run (loop=3D0x7fffd4002100) at gmain.= c:4116 #9 0x00007ffff7498dde in red_worker_main (arg=3D0x555556e2f050) at red-wor= ker.c:1369 #10 0x00007ffff70e458e in start_thread () at /lib64/libpthread.so.0 #11 0x00007ffff7013683 in clone () at /lib64/libc.so.6 (gdb) =3D=3D=3D diff --git a/hw/display/qxl.c b/hw/display/qxl.c index c8ce5781e0..632923add2 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -777,6 +777,9 @@ static void interface_release_resource(QXLInstance *sin, QXLReleaseRing *ring; uint64_t *item, id; =20 + if (!ext.info) { + return; + } if (ext.group_id =3D=3D MEMSLOT_GROUP_HOST) { /* host group -> vga mode update request */ QXLCommandExt *cmdext =3D (void *)(intptr_t)(ext.info->id); --=20 2.20.1