From nobody Fri May 3 10:31:25 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1506024641188856.8946405855837; Thu, 21 Sep 2017 13:10:41 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5FF8172FFB; Thu, 21 Sep 2017 20:10:39 +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 F04475C8B7; Thu, 21 Sep 2017 20:10:37 +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 B9FBE410B2; Thu, 21 Sep 2017 20:10:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8LJw9qR020270 for ; Thu, 21 Sep 2017 15:58:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 084B75E1A5; Thu, 21 Sep 2017 19:58:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0B4818039; Thu, 21 Sep 2017 19:58:06 +0000 (UTC) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) (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 CBFEC52748; Thu, 21 Sep 2017 19:58:05 +0000 (UTC) Received: by mail-pg0-f66.google.com with SMTP id u18so3977007pgo.1; Thu, 21 Sep 2017 12:58:05 -0700 (PDT) Received: from localhost.localdomain.localdomain ([24.6.85.152]) by smtp.gmail.com with ESMTPSA id b68sm4333646pfk.23.2017.09.21.12.58.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 12:58:04 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5FF8172FFB Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5FF8172FFB Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xj6nsYzy" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBFEC52748 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ashmit602@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CBFEC52748 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+Fx6epKWEulYgzeJZKESQiiucSM3WVPfuon9KD1f26Y=; b=Xj6nsYzyrGKl0Q4q3BnEViBrltcuW0yKri7Jeeft6l9JmaGB9OSI2dVBOVJFzG+9Mv znbZrAN1gqNUuZQd7PJ4Hro9o6T040mJ1QNiNLZX3o5EJd634pC5BKWlb2okImXG5Zr5 O5xEAwG35A6BqEFzzsys9uSpcz6A3SOiskdoHRe7OoDjuuQ0zuiu3DA/dF953mV6yEyA bLpf5hdmWh7+qDIZgcE8KiImNSfdsSRJk9qH+/rcGLHMOPYA317FCiUUZ2QW93/xPZeg 711wo54M85goRrmvZt4b0SdWhixMmznijkq2XM98nJgaZQyvNfIbhAlvDek01YSLeDoE 8sPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+Fx6epKWEulYgzeJZKESQiiucSM3WVPfuon9KD1f26Y=; b=VrwbPeZfAAYdeBovRD6EoXMzNeO8+tzsg02n7NiKy/qZmL/tCMtzbscuiQ76sYhckF 8oWdJSExr62PLMFDypnTPrXZhNwVo6dyiKAhmKTRWRDAwjFEsTNZtHCj52cYuYeqIhOX 5nIRQGiSK5wlj0oSTiWzKeG136AB1PJeZCDiJ0yTJEdCZAPUbCEKni1F4FH1XwjhnU7R oyMwvf8+VbIq1meAXlvyuPoAZxAbReEMtFE+swIMW+/ld1rjlYVkyZl816F6M7OJUMxN r9s6QsGRUULbu7yLDKkoPJyqARiCSRbLh4PaIQDzhQgvUnIGznLVWCmwiR40up3ssqFg dMsw== X-Gm-Message-State: AHPjjUg/KMMuHdd7sNkXeonP8RPqUrsORPI3sPDuoTLiM8eD8WelePxt B301siN8Zrign6C9FeWzh7z6TA== X-Google-Smtp-Source: AOwi7QDwKS/Kf48UyadP78jW6KbRFvfua3jV7CdY1/xUR6MZDeZziLUL5PnecC8kQrOzZI+9oKWyZA== X-Received: by 10.84.132.2 with SMTP id 2mr6613325ple.381.1506023884997; Thu, 21 Sep 2017 12:58:04 -0700 (PDT) From: Ashish Mittal To: libvir-list@redhat.com, jferlan@redhat.com, pkrempa@redhat.com, eskultet@redhat.com Date: Thu, 21 Sep 2017 12:57:27 -0700 Message-Id: <1506023847-3239-1-git-send-email-ashmit602@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 21 Sep 2017 19:58:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 21 Sep 2017 19:58:06 +0000 (UTC) for IP:'74.125.83.66' DOMAIN:'mail-pg0-f66.google.com' HELO:'mail-pg0-f66.google.com' FROM:'ashmit602@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.12 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.83.66 mail-pg0-f66.google.com 74.125.83.66 mail-pg0-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Ashish Mittal Subject: [libvirt] [PATCH v4] Avoid possible NULL pointer dereferences in qemuDomainGetTLSObjects 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 21 Sep 2017 20:10:40 +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" Passing a NULL value for the argument secAlias to the function qemuDomainGetTLSObjects can cause a segmentation fault in libvirtd. Fixed two possibile places where we could dereference a NULL secAlias. Signed-off-by: Ashish Mittal --- src/qemu/qemu_hotplug.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 7dd6e5f..7592049 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1638,12 +1638,14 @@ qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, if (qemuBuildSecretInfoProps(secinfo, secProps) < 0) return -1; =20 - if (!(*secAlias =3D qemuDomainGetSecretAESAlias(srcAlias, false))) + if (!secAlias || + !(*secAlias =3D qemuDomainGetSecretAESAlias(srcAlias, false))) return -1; } =20 if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen, tlsVerify, - *secAlias, qemuCaps, tlsProps) < 0) + secAlias ? *secAlias : NULL, qemuCaps, + tlsProps) < 0) return -1; =20 if (!(*tlsAlias =3D qemuAliasTLSObjFromSrcAlias(srcAlias))) --=20 2.5.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list