From nobody Fri Apr 19 20:47:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528749378193367.3607164396558; Mon, 11 Jun 2018 13:36:18 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 1D5DE4E33E; Mon, 11 Jun 2018 20:36:16 +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 341D0A09BD; Mon, 11 Jun 2018 20:36:15 +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 5731B1800FC1; Mon, 11 Jun 2018 20:36:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5BKaB6r030806 for ; Mon, 11 Jun 2018 16:36:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0DF4E8F6DF; Mon, 11 Jun 2018 20:36:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 00C7C5D97C for ; Mon, 11 Jun 2018 20:36:03 +0000 (UTC) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF123883B4 for ; Mon, 11 Jun 2018 20:35:52 +0000 (UTC) Received: by mail-qt0-f193.google.com with SMTP id l10-v6so16446277qtj.0 for ; Mon, 11 Jun 2018 13:35:52 -0700 (PDT) Received: from localhost.localdomain ([187.107.161.196]) by smtp.gmail.com with ESMTPSA id o5-v6sm29675800qtm.60.2018.06.11.13.35.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 13:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=LWI7+0qz2lOpQLtA3MeoOGKmTVuR1opZw8DntpXKyR0=; b=THScMtgNmELwW5blXGHZDbFxMpKUMms6xF+Sn1ddvuWopn6rKepZdEpa+q2Kb2E+il uIvhFUeypChFS/JJc4pPeDF7D3D38sVmbTudc/Sjz4CvC69VzqNpgyeKUS2F0t+IMz/M ep51LvTuIwiEbLixIk3eRPbWmkVXso7gqD+raub8ejQ9jW+dD4qxQqntZi9dc/RYvWFP Ue6Os3s2GPDVaiLTJUUO/IqqOJF0shThSeAVEzs9AgRhTL7kTJy/jDF/8m0zyzjWllLs rmX7jFa3B74BvcyriC+ceb2urkZMD3OgU9OrRpycfrsps/51fm5o8Gl/dLASY7rLrQ3G zR0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=LWI7+0qz2lOpQLtA3MeoOGKmTVuR1opZw8DntpXKyR0=; b=sb+72Xto6qPdsQI1S9bAZ2Zmg3ruM1UbywMeaJqpvFipnsQ7/NPo6OUTZ1IJ25FMei USlFDDCW9eyGRvTXaq4EGF3C4Tfb5gKhM8QuJk328q2w+Ym3gak0O10aiVmXG+5L2mhC hDmHuY9PWrpV89PTRTcjfozwWCnEr0n4CeIvm+Oki1eCQXnZayDKV80SBixohNrSsw3E JELtc77DAYNS+sMkJ9wdPU2rZs5E3QqkmW8p2bc4TMuopAFmhc7JcoGIzXEuULI19hK0 xEiE/mYVQK4dnVUw5BqDVl0VbYHuLI6Hnvqa06uyPnhFo8hYvZngCKsyrNSYQzlCZtHm bdjQ== X-Gm-Message-State: APt69E1BkwXwC24nVWBZRGHKQ2dfuXn67hM89Mu2YkxbVlo45BlLEz4C Jsw9b+nWMd/ORWb7MRPvDru07g== X-Google-Smtp-Source: ADUXVKLhqJOTCcUOW351QvGHLiRc5M1IYvC6TG9Jpw7QTbPcveIuTNCn1Gr4zBhXf/qJ6UIbyxftLg== X-Received: by 2002:ac8:25a5:: with SMTP id e34-v6mr746506qte.318.1528749351703; Mon, 11 Jun 2018 13:35:51 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 11 Jun 2018 17:35:33 -0300 Message-Id: <20180611203533.1481-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 11 Jun 2018 20:35:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 11 Jun 2018 20:35:52 +0000 (UTC) for IP:'209.85.216.193' DOMAIN:'mail-qt0-f193.google.com' HELO:'mail-qt0-f193.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.216.193 mail-qt0-f193.google.com 209.85.216.193 mail-qt0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] qemu: Fixing uninitialised variable inside virQEMUDriverConfigLoadFile. 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 11 Jun 2018 20:36:17 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since virConfGetValueBool() can return earlier, the parameter 'value' might be not initialised properly inside this method. Another proof: Valgrind is returning this error during the libvirtd daemon startup: =3D=3D16199=3D=3D Conditional jump or move depends on uninitialised value(s) =3D=3D16199=3D=3D at 0x27FFFEF4: virQEMUDriverConfigLoadFile (qemu_conf.= c:809) =3D=3D16199=3D=3D by 0x2807665C: qemuStateInitialize (qemu_driver.c:654) =3D=3D16199=3D=3D by 0x5535428: virStateInitialize (libvirt.c:662) =3D=3D16199=3D=3D by 0x12AED8: daemonRunStateInit (remote_daemon.c:802) =3D=3D16199=3D=3D by 0x536DE18: virThreadHelper (virthread.c:206) =3D=3D16199=3D=3D by 0x6CB36DA: start_thread (pthread_create.c:463) =3D=3D16199=3D=3D by 0x6FEC88E: clone (clone.S:95) Signed-off-by: Julio Faracco Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index f079ae3221..a4f545ef92 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -804,9 +804,9 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr = cfg, goto cleanup; if (virConfGetValueBool(conf, "clear_emulator_capabilities", &cfg->cle= arEmulatorCapabilities) < 0) goto cleanup; - if (virConfGetValueBool(conf, "allow_disk_format_probing", &tmp) < 0) + if ((rv =3D virConfGetValueBool(conf, "allow_disk_format_probing", &tm= p)) < 0) goto cleanup; - if (tmp) { + if (rv =3D=3D 1 && tmp) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("allow_disk_format_probing is no longer supported= ")); goto cleanup; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list