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 1746539968507133.83872416369718; Tue, 6 May 2025 06:59:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DB141144F; Tue, 6 May 2025 09:59:27 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B70FC13C9; Tue, 6 May 2025 09:58:48 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4D64D138B; Tue, 6 May 2025 09:53:47 -0400 (EDT) Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) (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 663D51397 for ; Tue, 6 May 2025 09:53:46 -0400 (EDT) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (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 4ZsKcH3DdFz51STY for ; Tue, 6 May 2025 21:53:35 +0800 (CST) Received: (from root@localhost) by mse-fl2.zte.com.cn id 546DrZXp003208 for ; Tue, 6 May 2025 21:53:35 +0800 (+08) (envelope-from liu.song13@zte.com.cn) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl1.zte.com.cn with SMTP id 546ATPuA086271 for ; Tue, 6 May 2025 18:29:25 +0800 (+08) (envelope-from liu.song13@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Tue, 6 May 2025 18:29:27 +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=-3.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_MED, 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: <202505061353.546DrZXp003208@mse-fl2.zte.com.cn> Date: Tue, 6 May 2025 18:29:27 +0800 (CST) X-Zmail-TransId: 2af96819e48716f-2d0f7 X-Mailer: Zmail v1.0 Mime-Version: 1.0 From: To: Subject: =?UTF-8?B?W1BBVENIIHYyXSB2aXJuZXRkZXZ0YXA6IEZpeCBtZW1vcnkgbGVhayBpbiB2aXJOZXREZXZUYXBSZWF0dGFjaEJyaWRnZQ==?= X-MAIL: mse-fl2.zte.com.cn 546DrZXp003208 X-MSS: AUDITRELEASE@mse-fl2.zte.com.cn X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 681A145F.001/4ZsKcH3DdFz51STY 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: 2FYWAAUKWRAF5UHQ52ZJPXRBG7CBPHJR X-Message-ID-Hash: 2FYWAAUKWRAF5UHQ52ZJPXRBG7CBPHJR X-Mailman-Approved-At: Tue, 06 May 2025 13:58:44 -0400 CC: zhang.qiangwei@zte.com.cn, jiang.xuexin@zte.com.cn, xue.zhihong@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: 1746539971299019000 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) Fixes: de938b92c9d3a47647164aa643c20d2fc96cd2bc 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..f26afb2ce0 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 = */ + g_clear_pointer(&master, g_free); if (virNetDevOpenvswitchInterfaceGetMaster(tapname, &master) < 0) return -1; } -- 2.27.0