From nobody Sun Apr 28 17:29:48 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 1505912254804866.2634695153525; Wed, 20 Sep 2017 05:57:34 -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 9D1B7267DB; Wed, 20 Sep 2017 12:57:33 +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 7B7A617551; Wed, 20 Sep 2017 12:57:33 +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 449764ED36; Wed, 20 Sep 2017 12:57:33 +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 v8KCXBLq000940 for ; Wed, 20 Sep 2017 08:33:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 550365D75A; Wed, 20 Sep 2017 12:33:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 39EF35D6B7; Wed, 20 Sep 2017 12:33:09 +0000 (UTC) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) (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 725D385546; Wed, 20 Sep 2017 12:33:08 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id a7so1138326pfj.5; Wed, 20 Sep 2017 05:33:08 -0700 (PDT) Received: from localhost.localdomain.localdomain ([24.6.85.152]) by smtp.gmail.com with ESMTPSA id b66sm7921318pfe.165.2017.09.20.05.33.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Sep 2017 05:33:06 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9D1B7267DB Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx06.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 9D1B7267DB Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z+HpBGIp" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 725D385546 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ashmit602@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 725D385546 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5YwJb68G8U6TvvOM9fPaVVHKrtyL+mmvfL9aww6ahpQ=; b=Z+HpBGIps1p21OQ0Afe0u2t3/TIuZHQSc+kFEAAaM7uoodCwFqHOGqKARTI/OGFuRE NbqrI7btqX2xl0H5mHkHpg7UDjIfTcJ5mNvdTnhaWPjxo0xcNTzpo/IgqsedNCUPKhP2 hc+KPeo1JLYOnx9XZXp+DWwzi5IdbhXpfiocVwge9bIsVM89fD3m8ifffWCia5vONUIc osEQEtOotKkDqOn/nqoIFM3p9ztrIAs5Pb/jaZ10OUuGoSJPRgw9NKym9NJdg7t8UMj2 vl9JAHS+Sgaxiz/aQq3NzfGLhYuEkAsOJh6cT+XaeXLZgRWRaCTEIUep2fv7hVdXOoVX Wj0w== 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=5YwJb68G8U6TvvOM9fPaVVHKrtyL+mmvfL9aww6ahpQ=; b=a8wEDNmSHwlYzyZSrvyv2JWAqUTicpRZUrNrnlTSEhH0Nqq4SES2fzfIVOL+50ESOH fSTnoF4V4JshI+fxg6QXGtRx/PNR29jggpUUdJAyL36EBsqJQY943q6OGmmIggbQdeuX j76s1gygp2+22iBJbVEu6HpUbukjAK0xV0nNz6AokEzSxt9rNfxiQ7NMd5PxM9cqxVj5 B/wBhjY9WTY5Z58pheXeM2pFgF7zzOgDaMmLmxM5mB2F1sc9rbW3CY+rJqn2QVWczmzq Y52uHhEIZs90sRn4iWtqFoYBJb95jQ5qv4DRo6gaUFXs2qHGWFamsleXleYNB4tNbwuH vk5g== X-Gm-Message-State: AHPjjUiPNVsftV1Yyw8j2G16sAQlvi8ixzPG3BjB2abBrU590Dw9zhFH zGMu+jov72RSefFSgd9JecuCcg== X-Google-Smtp-Source: AOwi7QDn+7uGhSe+0sBQ4EBS/vGMDwW6uKNkTgjXEy8pEzCG1QEHfcs3pK4zdmKNcGSY2Y6GczVGfg== X-Received: by 10.99.3.9 with SMTP id 9mr2001653pgd.205.1505910787661; Wed, 20 Sep 2017 05:33:07 -0700 (PDT) From: Ashish Mittal To: libvir-list@redhat.com, jferlan@redhat.com, pkrempa@redhat.com, eskultet@redhat.com Date: Wed, 20 Sep 2017 05:32:29 -0700 Message-Id: <1505910749-2945-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.28]); Wed, 20 Sep 2017 12:33:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 20 Sep 2017 12:33:08 +0000 (UTC) for IP:'209.85.192.195' DOMAIN:'mail-pf0-f195.google.com' HELO:'mail-pf0-f195.google.com' FROM:'ashmit602@gmail.com' RCPT:'' X-RedHat-Spam-Score: -2.16 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.192.195 mail-pf0-f195.google.com 209.85.192.195 mail-pf0-f195.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Ashish Mittal Subject: [libvirt] [PATCH v3] Avoid a possible NULL pointer dereference 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.30]); Wed, 20 Sep 2017 12:57:34 +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 would cause a segmentation fault in libvirtd. Changed code to not dereference a NULL secAlias. Signed-off-by: Ashish Mittal --- src/qemu/qemu_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 7dd6e5f..9ecdf0a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1643,7 +1643,8 @@ qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, } =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