From nobody Sun May 5 05:29:33 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1643129987; cv=none; d=zohomail.com; s=zohoarc; b=Aou2Fv6kjMcrJXPW/BFq19WIBe8nhl8JwU/4eb0XzLDlOV5JZoolj+FjKF2pmo2JjioDeHHa0SsHnM5ii2/SGp0EVRbdxH3F72wjaB5BD4ZZfvh31ZciKW3rnxN7WryONrDlPpiVP4ikh/TZgH1wJHw2z424kVlO4Keid7k7FNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643129987; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=OJN6DWEIOmVxhzvMMiFh4cHOWZ1texuFrwA2j7S1G9I=; b=CfFWVjZmEMzk2dJyyzzzHP2cqA68fBFOxgR5KaZukvhXN6/spcI86OiV0iqGv4GFx6cqcjInzzlJNBBjAPGFLqLd7b0hNLkTBgRcNCkT9LHb0CHsuvy4ehofQy5otwSDKKShWgX7VU+NcfkSvxCnY51wuGU7DFoa6976xiWh1Lk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1643129987231425.66408261924994; Tue, 25 Jan 2022 08:59:47 -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-290-TXhodRJ-MqGHouebrXRDaA-1; Tue, 25 Jan 2022 11:59:42 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 090291091DA1; Tue, 25 Jan 2022 16:59:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 667837F559; Tue, 25 Jan 2022 16:59:35 +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 265404BB7C; Tue, 25 Jan 2022 16:59:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20PGxUt2004896 for ; Tue, 25 Jan 2022 11:59:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id CCFA810A3943; Tue, 25 Jan 2022 16:59:30 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31D4010900A9 for ; Tue, 25 Jan 2022 16:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643129986; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=OJN6DWEIOmVxhzvMMiFh4cHOWZ1texuFrwA2j7S1G9I=; b=BxvYgD+ssJAevHYAZydBwXbtkgijHp54tRjpEkUcnIGREvKh+EkHk8rCipX9IisF4BBbz2 dNsZJj3ongrgPk2Ye/Na1ldJInzhPPGUXkGCv31MmjomRxkoW8iQoVlrpDNcJOmeUXYBxQ I81h/zMYc0a2N37HIxSkmPhhmeDy7vs= X-MC-Unique: TXhodRJ-MqGHouebrXRDaA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemuDomainSetupDisk: Initialize 'targetPaths' Date: Tue, 25 Jan 2022 17:59:28 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@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.12 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643129989633100001 Content-Type: text/plain; charset="utf-8" Compiler isn't able to see that 'virDevMapperGetTargets' in cases e.g. when the devmapper isn't available may not initialize the value in the pointer passed as the second argument. The usage 'qemuDomainSetupDisk' lead to an accidental infinite loop as previous calls apparently doctored the stack to a point where 'g_slist_concat' would end up in an infinite loop trying to find the end of the list. Fixes: 6c49c2ee9fc Closes: https://gitlab.com/libvirt/libvirt/-/issues/268 Signed-off-by: Peter Krempa Reviewed-by: Andrea Bolognani --- src/qemu/qemu_namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index 23b1160c5e..94453033f5 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -251,7 +251,7 @@ qemuDomainSetupDisk(virStorageSource *src, if (!(tmpPath =3D virPCIDeviceAddressGetIOMMUGroupDev(&next->n= vme->pciAddr))) return -1; } else { - GSList *targetPaths; + GSList *targetPaths =3D NULL; if (virStorageSourceIsEmpty(next) || !virStorageSourceIsLocalStorage(next)) { --=20 2.34.1