From nobody Fri Apr 19 17:23:16 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520948236049686.3475662076789; Tue, 13 Mar 2018 06:37:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B5BFC05004D; Tue, 13 Mar 2018 13:37:14 +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 1A39917D2C; Tue, 13 Mar 2018 13:37:13 +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 7194D4CA9A; Tue, 13 Mar 2018 13:37:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DDbAZ9023845 for ; Tue, 13 Mar 2018 09:37:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD53CAB3F2; Tue, 13 Mar 2018 13:37:10 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64999AB3FA for ; Tue, 13 Mar 2018 13:37:10 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 13 Mar 2018 14:37:04 +0100 Message-Id: <8f3164dcbed75b24f6d7b8c20ffc28cdd3665e8a.1520948163.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] virSysinfoParseX86Chassis: Store asset tag into correct pointer 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 13 Mar 2018 13:37:14 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Probably due to copy-paste error we're storing asset tag into def->sku which we even use in the next step to store SKU number and thus the asset tag leaks. =3D=3D19200=3D=3D 41 bytes in 1 blocks are definitely lost in loss record 8= 49 of 1,059 =3D=3D19200=3D=3D at 0x4C2AF0F: malloc (vg_replace_malloc.c:299) =3D=3D19200=3D=3D by 0x8785419: strndup (in /lib64/libc-2.25.so) =3D=3D19200=3D=3D by 0x53588D7: virStrndup (virstring.c:1023) =3D=3D19200=3D=3D by 0x535C6CF: virSysinfoParseX86Chassis (virsysinfo.c:= 882) =3D=3D19200=3D=3D by 0x535DA67: virSysinfoReadX86 (virsysinfo.c:1149) =3D=3D19200=3D=3D by 0x535DB3A: virSysinfoRead (virsysinfo.c:1206) =3D=3D19200=3D=3D by 0x2BE0B27E: qemuStateInitialize (qemu_driver.c:641) =3D=3D19200=3D=3D by 0x556AB4F: virStateInitialize (libvirt.c:770) =3D=3D19200=3D=3D by 0x1299B9: daemonRunStateInit (remote_daemon.c:846) =3D=3D19200=3D=3D by 0x5361A58: virThreadHelper (virthread.c:206) =3D=3D19200=3D=3D by 0x84E3896: start_thread (in /lib64/libpthread-2.25.= so) =3D=3D19200=3D=3D by 0x87F4CFE: clone (in /lib64/libc-2.25.so) Signed-off-by: Michal Privoznik --- src/util/virsysinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 137f14ae4..43a4c8835 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -879,7 +879,7 @@ virSysinfoParseX86Chassis(const char *base, if ((cur =3D strstr(base, "Asset Tag: ")) !=3D NULL) { cur +=3D 11; eol =3D strchr(cur, '\n'); - if (eol && VIR_STRNDUP(def->sku, cur, eol - cur) < 0) + if (eol && VIR_STRNDUP(def->asset, cur, eol - cur) < 0) goto cleanup; } if ((cur =3D strstr(base, "SKU Number: ")) !=3D NULL) { --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 19 17:23:16 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520948252134390.4164480064892; Tue, 13 Mar 2018 06:37:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C85B9C0587C1; Tue, 13 Mar 2018 13:37:30 +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 A04BA176D2; Tue, 13 Mar 2018 13:37:30 +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 5E885180613A; Tue, 13 Mar 2018 13:37:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2DDbBWP023850 for ; Tue, 13 Mar 2018 09:37:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5B2267C41; Tue, 13 Mar 2018 13:37:11 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0246FAB3F5 for ; Tue, 13 Mar 2018 13:37:10 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 13 Mar 2018 14:37:05 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] virSecurityDACChownListFree: Don't leak list->items array 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 13 Mar 2018 13:37:31 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We're freeing individual items in it but not the array itself. =3D=3D19200=3D=3D 40 bytes in 1 blocks are definitely lost in loss record 8= 47 of 1,059 =3D=3D19200=3D=3D at 0x4C2D12F: realloc (vg_replace_malloc.c:785) =3D=3D19200=3D=3D by 0x52C5532: virReallocN (viralloc.c:245) =3D=3D19200=3D=3D by 0x52C5628: virExpandN (viralloc.c:294) =3D=3D19200=3D=3D by 0x52C58FC: virInsertElementsN (viralloc.c:436) =3D=3D19200=3D=3D by 0x542856B: virSecurityDACChownListAppend (security_= dac.c:115) =3D=3D19200=3D=3D by 0x54286B4: virSecurityDACTransactionAppend (securit= y_dac.c:167) =3D=3D19200=3D=3D by 0x542902F: virSecurityDACSetOwnershipInternal (secu= rity_dac.c:560) =3D=3D19200=3D=3D by 0x54295D6: virSecurityDACSetOwnership (security_dac= .c:650) =3D=3D19200=3D=3D by 0x542AEE0: virSecurityDACSetInputLabel (security_da= c.c:1472) =3D=3D19200=3D=3D by 0x542B61D: virSecurityDACSetAllLabel (security_dac.= c:1693) =3D=3D19200=3D=3D by 0x542DD67: virSecurityManagerSetAllLabel (security_= manager.c:869) =3D=3D19200=3D=3D by 0x54279C2: virSecurityStackSetAllLabel (security_st= ack.c:361) Signed-off-by: Michal Privoznik --- src/security/security_dac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 74446d664..663c8c9ea 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -137,6 +137,7 @@ virSecurityDACChownListFree(void *opaque) VIR_FREE(list->items[i]->path); VIR_FREE(list->items[i]); } + VIR_FREE(list->items); VIR_FREE(list); } =20 --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list