From nobody Sat May 11 14:31:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16461569037751000.4788929878241; Tue, 1 Mar 2022 09:48:23 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-154-i4Na74cWMAaGGbkApbkFEA-1; Tue, 01 Mar 2022 12:48:21 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 809141091DA6; Tue, 1 Mar 2022 17:48:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8178884780; Tue, 1 Mar 2022 17:48:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AD97D1809CB3; Tue, 1 Mar 2022 17:48:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 221Hm8J7012018 for ; Tue, 1 Mar 2022 12:48:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id A5C9058A490; Tue, 1 Mar 2022 17:48:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A18A058A48E for ; Tue, 1 Mar 2022 17:48:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A47385A5BC for ; Tue, 1 Mar 2022 17:48:08 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474-aUY4mixPNN-8BjvuAHsARw-1; Tue, 01 Mar 2022 12:48:06 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 221HCPeb004695; Tue, 1 Mar 2022 17:48:06 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com with ESMTP id 3ehqp50t5n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Mar 2022 17:48:05 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 221HZlRk014312; Tue, 1 Mar 2022 17:48:04 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma02fra.de.ibm.com with ESMTP id 3efbu9b9dd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Mar 2022 17:48:04 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 221Hm1mC45941188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Mar 2022 17:48:01 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71EF74C044; Tue, 1 Mar 2022 17:48:01 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F4034C040; Tue, 1 Mar 2022 17:48:01 +0000 (GMT) Received: from localhost.localdomain (unknown [9.171.19.216]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 1 Mar 2022 17:48:01 +0000 (GMT) X-MC-Unique: i4Na74cWMAaGGbkApbkFEA-1 X-MC-Unique: aUY4mixPNN-8BjvuAHsARw-1 From: Boris Fiuczynski To: libvir-list@redhat.com, berrange@redhat.com Subject: [PATCH] qemu: segmentation fault in virtqemud executing qemuDomainUndefineFlags Date: Tue, 1 Mar 2022 18:47:59 +0100 Message-Id: <20220301174759.149847-1-fiuczy@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: yv7GmiwBl9OAs96R4VBoyw44aXdBQpde X-Proofpoint-ORIG-GUID: yv7GmiwBl9OAs96R4VBoyw44aXdBQpde X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205, Aquarius:18.0.816, Hydra:6.0.425, FMLib:17.11.64.514 definitions=2022-03-01_07,2022-02-26_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 phishscore=0 spamscore=0 clxscore=1011 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2203010091 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, jdenemar@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1646156905256100001 Content-Type: text/plain; charset="utf-8" Commit 5adfb3472342741c443ac91dee0abb18b5a3d038 causes a segmentation fault. Stack trace of thread 664419: #0 0x000003ff62ec553c in qemuDomainUndefineFlags (dom=3D0x3ff6c002810, fl= ags=3D) at ../src/qemu/qemu_driver.c:6618 #1 0x000003ff876a7e5c in virDomainUndefineFlags (domain=3Ddomain@entry=3D= 0x3ff6c002810, flags=3D) at ../src/libvirt-domain.c:6519 #2 0x000002aa2b64a808 in remoteDispatchDomainUndefineFlags (server=3D0x2a= a2c3d7880, msg=3D0x2aa2c3d2770, args=3D, rerr=3D0x3ff8287b95= 0, client=3D) at src/remote/remote_daemon_dispatch_stubs.h:13080 #3 remoteDispatchDomainUndefineFlagsHelper (server=3D0x2aa2c3d7880, clien= t=3D, msg=3D0x2aa2c3d2770, rerr=3D0x3ff8287b950, args=3D, ret=3D0x0) at src/remote/remote_daemon_dispatch_stubs.h:13059 #4 0x000003ff8758bbf4 in virNetServerProgramDispatchCall (msg=3D0x2aa2c3d= 2770, client=3D0x2aa2c3e3050, server=3D0x2aa2c3d7880, prog=3D0x2aa2c3d8010) at ../src/rpc/virnetserverprogram.c:428 #5 virNetServerProgramDispatch (prog=3D0x2aa2c3d8010, server=3Dserver@ent= ry=3D0x2aa2c3d7880, client=3D0x2aa2c3e3050, msg=3D0x2aa2c3d2770) at ../src/= rpc/virnetserverprogram.c:302 #6 0x000003ff8758c260 in virNetServerProcessMsg (msg=3D, p= rog=3D, client=3D, srv=3D0x2aa2c3d7880) at ..= /src/rpc/virnetserver.c:140 #7 virNetServerHandleJob (jobOpaque=3D0x2aa2c3e2d30, opaque=3D0x2aa2c3d78= 80) at ../src/rpc/virnetserver.c:160 #8 0x000003ff874c49aa in virThreadPoolWorker (opaque=3D) a= t ../src/util/virthreadpool.c:164 #9 0x000003ff874c3f62 in virThreadHelper (data=3D) at ../s= rc/util/virthread.c:256 #10 0x000003ff86c1cf8c in start_thread () from /lib64/libc.so.6 #11 0x000003ff86c9650e in thread_start () from /lib64/libc.so.6 Signed-off-by: Boris Fiuczynski Reviewed-by: Jim Fehlig --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b74b0375a7..18f1156862 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6615,7 +6615,7 @@ qemuDomainUndefineFlags(virDomainPtr dom, } } =20 - if (vm->def->os.loader->nvram) { + if (vm->def->os.loader && vm->def->os.loader->nvram) { nvram_path =3D g_strdup(vm->def->os.loader->nvram); } else if (vm->def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)= { qemuDomainNVRAMPathFormat(cfg, vm->def, &nvram_path); --=20 2.33.1