From nobody Tue Sep 9 03:17:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=zte.com.cn Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1746517767433315.6687096082778; Tue, 6 May 2025 00:49:27 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8304513FC; Tue, 6 May 2025 03:49:26 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5A36114C7; Tue, 6 May 2025 03:47:57 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 884C31380; Tue, 6 May 2025 00:18:57 -0400 (EDT) Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 9EAD512C1 for ; Tue, 6 May 2025 00:18:55 -0400 (EDT) Received: from mxde.zte.com.cn (unknown [10.35.20.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Zs4s44YrwzKjT for ; Tue, 6 May 2025 12:18:48 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4Zs4s13xvqzBRHKS for ; Tue, 6 May 2025 12:18:45 +0800 (CST) Received: from mxct.zte.com.cn (unknown [192.168.251.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4Zs4rq0w05z8R03d for ; Tue, 6 May 2025 12:18:35 +0800 (CST) Received: from mse-db.zte.com.cn (unknown [10.5.228.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Zs4rc5FzLz51SYw for ; Tue, 6 May 2025 12:18:24 +0800 (CST) Received: (from root@localhost) by mse-db.zte.com.cn id 5464IPlo001320 for ; Tue, 6 May 2025 12:18:25 +0800 (+08) (envelope-from liu.song13@zte.com.cn) Received: from xaxapp04.zte.com.cn ([10.99.98.157]) by mse-fl1.zte.com.cn with SMTP id 5462lW0A097555 for ; Tue, 6 May 2025 10:47:32 +0800 (+08) (envelope-from liu.song13@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Tue, 6 May 2025 10:47:34 +0800 (CST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.4 Message-Id: <202505060418.5464IPlo001320@mse-db.zte.com.cn> Date: Tue, 6 May 2025 10:47:34 +0800 (CST) X-Zmail-TransId: 2afa68197846fffffffff08-7a141 X-Mailer: Zmail v1.0 Mime-Version: 1.0 From: To: Subject: =?UTF-8?B?W1BBVENIXSB2aXJuZXRkZXZ0YXA6IEZpeCBtZW1vcnkgbGVhayBpbiB2aXJOZXREZXZUYXBSZWF0dGFjaEJyaWRnZQ==?= X-MAIL: mse-db.zte.com.cn 5464IPlo001320 X-MSS: AUDITRELEASE@mse-db.zte.com.cn X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 68198DA7.000/4Zs4s44YrwzKjT X-MailFrom: liu.song13@zte.com.cn X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: NVQXHRTX5VK57ED6TLD6ZRVR3DBLF5BE X-Message-ID-Hash: NVQXHRTX5VK57ED6TLD6ZRVR3DBLF5BE X-Mailman-Approved-At: Tue, 06 May 2025 07:47:54 -0400 CC: jiang.xuexin@zte.com.cn, xue.zhihong@zte.com.cn, zhang.qiangwei@zte.com.cn X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZM-MESSAGEID: 1746517769522116600 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: QiangWei Zhang Variable 'master' needs to be free because it will be reassigned in virNetDevOpenvswitchInterfaceGetMaster(). The leaked stack: Direct leak of 11 byte(s) in 1 object(s) allocated from: #0 0x7f7dad8ba6df in __interceptor_malloc (/lib64/libasan.so.8+0xba6df) #1 0x7f7dad715728 in g_malloc (/lib64/libglib-2.0.so.0+0x60728) #2 0x7f7dad72d8b2 in g_strdup (/lib64/libglib-2.0.so.0+0x788b2) #3 0x7f7dacb63088 in g_strdup_inline /usr/include/glib-2.0/glib/gstrfuncs.h= :321 #4 0x7f7dacb63088 in virNetDevGetName ../src/util/virnetdev.c:823 #5 0x7f7dacb63886 in virNetDevGetMaster ../src/util/virnetdev.c:909 #6 0x7f7dacb90288 in virNetDevTapReattachBridge ../src/util/virnetdevtap.c:= 527 #7 0x7f7dacd5cd67 in virDomainNetNotifyActualDevice ../src/conf/domain_conf= .c:30505 #8 0x7f7da3a10bc3 in qemuProcessNotifyNets ../src/qemu/qemu_process.c:3290 #9 0x7f7da3a375c6 in qemuProcessReconnect ../src/qemu/qemu_process.c:9211 #10 0x7f7dacc0cc53 in virThreadHelper ../src/util/virthread.c:256 #11 0x7f7dac2875d4 in start_thread (/lib64/libc.so.6+0x875d4) #12 0x7f7dac3091bb in __GI___clone3 (/lib64/libc.so.6+0x1091bb) Signed-off-by: QiangWei Zhang Reviewed-by: Peter Krempa --- src/util/virnetdevtap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 1dc77f0f5c..860a8e2dd5 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -541,6 +541,9 @@ virNetDevTapReattachBridge(const char *tapname, /* IFLA_MASTER for a tap on an OVS switch is always "ovs-system" */ if (STREQ_NULLABLE(master, "ovs-system")) { useOVS =3D true; + + /* master needs to be released here because it will be reassigned */ + VIR_FREE(master); if (virNetDevOpenvswitchInterfaceGetMaster(tapname, &master) < 0) return -1; } -- 2.27.0