From nobody Sun May 5 20:25:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574081852; cv=none; d=zoho.com; s=zohoarc; b=Sccs2EwZbkjatdBtnWRrg2w4jsA+KR9eMyqHQ6sqQ+XAGj5zxEkf+MPRdvBLvFD0TVL6poPyTUjNi7JgjzVPKNY31ZSnCzR52BIGLJAUnxuruc+deUec7NWyB2cy3i+DxhFp4m7nclUY0PCNsJq6oPi/agALcW0UArrSl8ISCxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574081852; h=Content-Type: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; bh=/h6gkKgm4FZQL5iV2TeKZTbSkEB0V1SsRv/7HNVECSA=; b=MgH4ml0JS1obzHMfqmsfRGc+GPJvKuaO3hf7zECFL/N3i4FQjdwJSBoE7qOkOyGFe6ZwLJsWEsPcJmtLLDIzwu7NyZYXL2vncuooo0xSGx+lk3eKUw1QYDEjx9A3fZYVO8GBCa/sYC6dag8jiHu0vnSMsVN9ZiJozm/c6wViNDk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574081852315645.1287711610994; Mon, 18 Nov 2019 04:57:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-vcg-rpOcPm-HSayd4hI_-g-1; Mon, 18 Nov 2019 07:57:29 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59A9B8EB7B5; Mon, 18 Nov 2019 12:57:23 +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 B17FA60905; Mon, 18 Nov 2019 12:57:22 +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 E639318089CD; Mon, 18 Nov 2019 12:57:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAICvIuI016744 for ; Mon, 18 Nov 2019 07:57:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4BB92627D7; Mon, 18 Nov 2019 12:57:18 +0000 (UTC) Received: from ridgehead.redhat.com (unknown [10.43.2.116]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2B7362965; Mon, 18 Nov 2019 12:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574081851; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/h6gkKgm4FZQL5iV2TeKZTbSkEB0V1SsRv/7HNVECSA=; b=VnLZmRb8zznGfISz4aD/OQtf95Dzo7JZOaNV1Fgb71iVCXXyGL1MdSgZ0Sp8V6Vgpkq+MP LdhQ5aaJOmdbP+4bKBoRbRfEiTKrDyrUqC+ltmRxS/ZG3HUC/0Rnt7h7LPvczkLA3rFlby lYtZ23yBCnzjCU3/ZiPCHfAD9/Klri4= From: Erik Skultety To: libvir-list@redhat.com Date: Mon, 18 Nov 2019 13:57:14 +0100 Message-Id: <0c320d39dd05607f89255e6559a943c050fadcff.1574081795.git.eskultet@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH] qemu: Fix NULL ptr dereference caused by qemuDomainDefFormatBufInternal 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.13 X-MC-Unique: vcg-rpOcPm-HSayd4hI_-g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" qemuDomainDefFormatBufInternal function wasn't testing whether the CPU was actually defined in the XML and saving such a domain resulted in the following backtrace: 0 in qemuDomainMakeCPUMigratable (cpu=3D0x0) 1 in qemuDomainDefFormatBufInternal() 2 in qemuDomainDefFormatXMLInternal() 3 in qemuDomainDefFormatLive() 4 in qemuDomainSaveInternal() 5 in qemuDomainSaveFlags() 6 in qemuDomainSave() 7 in virDomainSave() Signed-off-by: Erik Skultety Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e14b414518..ed2a5cc7b6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9105,7 +9105,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr drive= r, goto cleanup; } =20 - if (qemuDomainMakeCPUMigratable(def->cpu) < 0) + if (def->cpu && qemuDomainMakeCPUMigratable(def->cpu) < 0) goto cleanup; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list