From nobody Mon Sep 14 09:39:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1788473170; cv=none; d=zohomail.com; s=zohoarc; b=V491h2568UZk8h7ITa7CRTPIzOzF2zbIHoyxeZogKgVQAWMElwBi0K4NTJPdHOQ3VLSB4SLTI3jhmWjbp8ujbP567klz+hYuhp4QfkdvmWbU95sIW4u3LGc8kf8cNo37n0pD1hy5BN3EdhTeTxV7nagshAhIHaeZPn4lQXSLdes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788473170; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pRqBD/PHDASXS3lwKxlGehkJB1IW1YP1x7TTWwTOVik=; b=DknsfxVYow6jSJec8Wj/gQODcfjOZ6M4dVXUP1FfOMMmvC1Io3eaKGDCIBxCcPVG1p0x2oCn3iuG3xyQXsJ/GJqAn/CmYE/Fz+8CZlga5i3zHcM4M2VpWHvbupTmANVLyxKLOtCenYdvwItADlTUPQS87PWz9RzhV8DPKO+cmac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788473170385481.19942318894084; Thu, 3 Sep 2026 15:06:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2FZ3-00072e-Rt; Thu, 03 Sep 2026 18:05:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2FYy-000722-6n for qemu-devel@nongnu.org; Thu, 03 Sep 2026 18:05:40 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x2FYw-0003Xv-F9 for qemu-devel@nongnu.org; Thu, 03 Sep 2026 18:05:39 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7BCAF1FB72; Thu, 3 Sep 2026 22:05:28 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4FE2913736; Thu, 3 Sep 2026 22:05:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +Jl5CCfvmWppUQAAD6G6ig (envelope-from ); Thu, 03 Sep 2026 22:05:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1788473132; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pRqBD/PHDASXS3lwKxlGehkJB1IW1YP1x7TTWwTOVik=; b=cYZjg8QjSy+djof7lRdOhAqxLNQ2f9fimehc2a51UlrcTjqePOYfFoM8tq02aSPh+JHXER z/He+dbbw2YhxlUTQQmQiU04rG53siK6TXp05WRFRS9aEMIKzRZCqn0fZoUnkyccQH1g/F lpCt1GbgDNpi7LptW1/RXfOrz190nzM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1788473132; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pRqBD/PHDASXS3lwKxlGehkJB1IW1YP1x7TTWwTOVik=; b=5VjqICQLZBNTggQvGxvsyYP4sOWCcG0kDeIKWRJgInTxgMklpzL3n5zmmPgMemX3TEHu9x SRlJjXioZuIM4oDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="PfBgtAS/"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ZtJKZB4c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1788473128; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pRqBD/PHDASXS3lwKxlGehkJB1IW1YP1x7TTWwTOVik=; b=PfBgtAS/FqogqjD5gjnl2eQ7jo9yqoFXjtYQg6LiXtC/Th+6wGpfoPJbQ+aD+6AFZwmeo8 sf3i78Ck3GQ3snsGSVGx93Zq6AJpXFVy30cwfb3SyW8N2Z9tBSAQ++eKBtoR3z8NUtDWlp RHQYB65xwL3JRjAcSNdPjRkOZynyQPw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1788473128; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pRqBD/PHDASXS3lwKxlGehkJB1IW1YP1x7TTWwTOVik=; b=ZtJKZB4cGp8ETKq+RtxJNKiBqMSsYwgdhWYsRW53wb41E4e02WNyFT6P5YukJXtJWGyTh2 m46kAIwZzfShweCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: John Snow , "Denis V. Lunev" Subject: [PATCH 1/3] ahci: Fix leak of IRQState Date: Thu, 3 Sep 2026 19:05:21 -0300 Message-ID: <20260903220523.2849019-2-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903220523.2849019-1-farosas@suse.de> References: <20260903220523.2849019-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.01 X-Rspamd-Queue-Id: 7BCAF1FB72 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:email,suse.de:mid]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1788473173523158500 Content-Type: text/plain; charset="utf-8" ASAN spotted an indirect leak in ahci-test: Indirect leak of 576 byte(s) in 6 object(s) allocated from: #0 0x556112a08ca0 in malloc #1 0x7f21591e595d in g_malloc #2 0x7f21591ffe38 in g_slice_alloc #3 0x7f21591c988d in g_hash_table_new_full #4 0x556114d756f1 in object_initialize_with_type ../qom/object.c:506:23 #5 0x556114d77590 in object_new_with_type ../qom/object.c:706:5 #6 0x556114d777e8 in object_new ../qom/object.c:722:12 #7 0x556114d6d2be in qemu_allocate_irq ../hw/core/irq.c:94:25 #8 0x556114d6d1bc in qemu_extend_irqs ../hw/core/irq.c:82:16 #9 0x556114d6d329 in qemu_allocate_irqs ../hw/core/irq.c:89:12 #10 0x5561135da9bd in ahci_realize ../hw/ide/ahci.c:1644:12 #11 0x55611360156a in pci_ich9_ahci_realize ../hw/ide/ich.c:132:5 Although ahci_realize() frees the return of qemu_allocate_irqs() right away, the individual IRQStates are still left around. Issue qemu_free_irq() at ahci_uninit(). Signed-off-by: Fabiano Rosas Reviewed-by: Denis V. Lunev --- hw/ide/ahci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 6b04762c4a..86f6297dc9 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1688,6 +1688,7 @@ void ahci_uninit(AHCIState *s) } ide_exit(ide_state); } + qemu_free_irq(ad->port.irq); object_unparent(OBJECT(&ad->port)); } =20 --=20 2.53.0 From nobody Mon Sep 14 09:39:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1788473171; cv=none; d=zohomail.com; s=zohoarc; b=R2Xj4qF5hyIj0p++qeSJFPl61qGQKfdfJQHCuaxI0pDK24uzkhT7ES3cKGnuIGhtcT98rbrzV+8S1onSaDPckv1eDiTe2ysmMAfJut64e/56JVaCW2MvVXExYyu6jye2lgJn/qcm1s9+9smVSz9uc4u85d8UkgBShrEHjCON/K4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788473171; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5EYRbSgft2VgPr98eYwep2GCDB37oUZvrs46N1Dm/hk=; b=Sn97UOAyb2/zenNOl3NmdkvHnc3k+pghpOqN/0Ii/WSCJ7aaLCgR9f2o6sNwdsEWDFhu5yjEU2GL5ygyNvEfuCo6+uHYUfXU4hNpcOQbmUodOOskk4IWCDelXK2qus5C1/7pk/BjGsp2D5zqgTXwAm7ORroL1kfSuGGqc8TRfmU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788473171010499.43483194774717; Thu, 3 Sep 2026 15:06:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2FZ9-00074B-5D; Thu, 03 Sep 2026 18:05:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2FZ0-00072H-46 for qemu-devel@nongnu.org; Thu, 03 Sep 2026 18:05:42 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x2FYx-0003Xz-2e for qemu-devel@nongnu.org; Thu, 03 Sep 2026 18:05:40 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A26681FBA8; Thu, 3 Sep 2026 22:05:29 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A1AE913738; Thu, 3 Sep 2026 22:05:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MNlrHCjvmWppUQAAD6G6ig (envelope-from ); Thu, 03 Sep 2026 22:05:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1788473133; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5EYRbSgft2VgPr98eYwep2GCDB37oUZvrs46N1Dm/hk=; b=MGrQV7dH3I4AP3neEDRZVLLElDEqUY6GZJN514FPdCHD4xCFpCLq+TEK6beuUcexP78q/Z +lmWFWjUnHow8PIeBvLdL64VfqHqjqISXq7+xMMTCkHibnZQofKeKeqBrYSPYmhjNBaN+r heW4El5ie9mn23uM9bmAH588LCBRmI0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1788473133; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5EYRbSgft2VgPr98eYwep2GCDB37oUZvrs46N1Dm/hk=; b=+oc1MOmN+DHxvYh/8MyTTm5QukkXyJ2cx7cStUB1uSPO5zAtjZdxdeFaBnMjC1wpg2WGGH Y88AT3FEEZVweLBQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=bim6vuUJ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=+zfy6MDi DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1788473129; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5EYRbSgft2VgPr98eYwep2GCDB37oUZvrs46N1Dm/hk=; b=bim6vuUJWQI7K2OpvJj6alIJDFfB4vsdHSVDd1eVUlC6CQ++I3B9n7A72A1mu/aFE+u7fq /YeS7UbLRX/82N1rQiXeCVdFm2eqUFEiNjNuNIdlR57cuFbbNrAgZmDvZJk7D7i5pZLdQy 8khOsqkEzVO0Sd87/ja7JoPHjkLaxmM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1788473129; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5EYRbSgft2VgPr98eYwep2GCDB37oUZvrs46N1Dm/hk=; b=+zfy6MDiJPdb70saIlxXXOWz1xoI3k5ReSU2tizvofjuzgkft546NlBh34Ft4QkLBNrI8+ 4EeSQpG5eZOaZIAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PATCH 2/3] migration: Drop iochannel reference during snapshot setup Date: Thu, 3 Sep 2026 19:05:22 -0300 Message-ID: <20260903220523.2849019-3-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903220523.2849019-1-farosas@suse.de> References: <20260903220523.2849019-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: A26681FBA8 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.de:email,suse.de:mid]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1788473173527158500 Content-Type: text/plain; charset="utf-8" During migration there are usually two references to the iochannel, one from the channel creation itself and another from the ownership transfer into QEMUFile. - The reference from the QEMUFile is decremented at qemu_fclose. - The original reference is decremented at migration_connect_outgoing() for regular migration and not at all for snapshots. The ide-test has recently added migration support and ASAN has flagged: Indirect leak of 32 byte(s) in 1 object(s) allocated from: #0 0x55ca12aac0b9 in realloc #1 0x7fd97d7e5a05 in g_realloc #3 0x7fd97d7c98c6 in g_hash_table_new_full #4 0x55ca14e186f1 in object_initialize_with_type ../qom/object.c:506:23 #5 0x55ca14e1a590 in object_new_with_type ../qom/object.c:706:5 #6 0x55ca14e1a7e8 in object_new ../qom/object.c:722:12 #7 0x55ca12de896f in qio_channel_block_new ../migration/channel-block.c= :32:29 #8 0x55ca12ec8f2d in qemu_fopen_bdrv ../migration/savevm.c:172:49 #9 0x55ca12ec8b42 in save_snapshot ../migration/savevm.c:3375:9 #10 0x55ca12ee18e3 in hmp_savevm ../migration/migration-hmp-cmds.c:497:5 Change qemu_fopen_bdrv() to drop the original reference once the QEMUFile has taken over the object. The xen code already does the same. Signed-off-by: Fabiano Rosas Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Xu --- migration/savevm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 5b0e89ca7c..8d4bdc28ab 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -168,11 +168,16 @@ static bool qemu_loadvm_thread_pool_wait(MigrationSta= te *s, =20 static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int is_writable) { + QIOChannel *ioc =3D QIO_CHANNEL(qio_channel_block_new(bs)); + QEMUFile *f; + if (is_writable) { - return qemu_file_new_output(QIO_CHANNEL(qio_channel_block_new(bs))= ); + f =3D qemu_file_new_output(ioc); } else { - return qemu_file_new_input(QIO_CHANNEL(qio_channel_block_new(bs))); + f =3D qemu_file_new_input(ioc); } + object_unref(ioc); + return f; } =20 =20 --=20 2.53.0 From nobody Mon Sep 14 09:39:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1788473186; cv=none; d=zohomail.com; s=zohoarc; b=oJpX7LuPsWwZ/nrPW5z0Za/HOnf0E+x9Mhje1bkDDkw50VUni+AOcgRKZLquDUJcmpSW79Vm7ZimuimYKPiYj8o4kh54sK8nm1T5ILnCfRe/qeJKMLl7Tnoyhgy9/7C5B9jPC55/Rzibf7906IEdYk+Tr2kccXf1f4xjEVQDKMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788473186; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jYLBkV1ylKw6NH3s0B5Xr4pifVev5evnseeNUB3+u+Y=; b=Yxtx8gZT+PhznHeMiLmOYxfZq4joSYXXcNfEgnFqobu/pC4dntB+z3IgZaf1J6kTRPMkX9nYTt4REy4nmufePv5FHYssTEP1rgDtW1nNFK0r4PVFIhGUVtnSEnMErp3AWFstMaReWC/waC8BvQdc6u0HSFzN34vZybLEk3IGw1E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788473186387334.8463951755783; Thu, 3 Sep 2026 15:06:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2FZ8-000736-2k; Thu, 03 Sep 2026 18:05:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2FZ1-00072K-9a for qemu-devel@nongnu.org; Thu, 03 Sep 2026 18:05:43 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1x2FYy-0003Y9-6K for qemu-devel@nongnu.org; Thu, 03 Sep 2026 18:05:43 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CC88E22345; Thu, 3 Sep 2026 22:05:30 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CE51A13869; Thu, 3 Sep 2026 22:05:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +A9TJynvmWppUQAAD6G6ig (envelope-from ); Thu, 03 Sep 2026 22:05:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1788473134; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYLBkV1ylKw6NH3s0B5Xr4pifVev5evnseeNUB3+u+Y=; b=bpcvxp0gn0ISNOpweP2WexbBoHBb1Bjpp9B+lFatoGUWR45GjLb0NKKGZgHL6+cUS3ZWhU SAKgsU88hdtytLWoNy8v6aKd9gl2ghPA3GUqKDMiwM0Yy/+2igxEldMXEATgYAJKeEgNAN I4cftM4Ff6girh0qFrglUtEmD8Ew1XA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1788473134; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYLBkV1ylKw6NH3s0B5Xr4pifVev5evnseeNUB3+u+Y=; b=r+ma7/jkyOZ0QdAx1kD+wgiCtMhckfkCyFSMBMHOcplkKpVF5NvJ1PNQTkCsVUdIOJ27jH Yeph3yOlKsD3ybAw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1788473130; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYLBkV1ylKw6NH3s0B5Xr4pifVev5evnseeNUB3+u+Y=; b=bZq+OFSmjw0i5AA1xNGCdAwXM/VV3Drw64aHnetXHhkY6sVCUHWabGqmOjM4kT69uvWRI6 yLl9k6ULW1TszOrKQ/6ffMOf24UyNauoAimzsrwC+Zn0+NjUpNh1fgBRgqW/azfoIUBvwY /JTigoQbg14nhSG2X++r2EUr3xedFZQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1788473130; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jYLBkV1ylKw6NH3s0B5Xr4pifVev5evnseeNUB3+u+Y=; b=rzH09Eefjk5AzRwemmprz0o4SYLM24IO8DRODYD78sacUeVRLHhD0iyMvpw7FIasoylYDj 6nbFNcVLCUjx3dBg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PATCH 3/3] migration: Free the JSON writer during snapshots Date: Thu, 3 Sep 2026 19:05:23 -0300 Message-ID: <20260903220523.2849019-4-farosas@suse.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903220523.2849019-1-farosas@suse.de> References: <20260903220523.2849019-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1788473189032158500 Content-Type: text/plain; charset="utf-8" The JSON writer is created at migrate_init() and freed at migration_cleanup(). The latter is not called for snapshots. Add a call to migration_cleanup_json_writer() to make sure it doesn't leak: Indirect leak of 24 byte(s) in 1 object(s) allocated from: #0 0x55ca12aabca0 in malloc #1 0x7fd97d7e595d in g_malloc #2 0x7fd97d7ffe38 in g_slice_alloc #3 0x7fd97d8042e2 in g_string_sized_new #4 0x55ca1571dd6b in json_writer_new ../qobject/json-writer.c:36:24 #5 0x55ca12e0de56 in migrate_init ../migration/migration.c:1718:21 #6 0x55ca12ec8fe6 in qemu_savevm_state ../migration/savevm.c:1921:11 #7 0x55ca12ec8b93 in save_snapshot ../migration/savevm.c:3380:11 Signed-off-by: Fabiano Rosas --- migration/migration.c | 2 +- migration/migration.h | 1 + migration/savevm.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b413d28622..d0b864a760 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1330,7 +1330,7 @@ void migrate_set_state(MigrationStatus *state, Migrat= ionStatus old_state, } } =20 -static void migration_cleanup_json_writer(MigrationState *s) +void migration_cleanup_json_writer(MigrationState *s) { g_clear_pointer(&s->vmdesc, json_writer_free); } diff --git a/migration/migration.h b/migration/migration.h index e47ff4e3d1..683bc7bdd5 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -633,4 +633,5 @@ void migration_bitmap_sync_precopy(bool last_stage); void dirty_bitmap_mig_init(void); bool should_send_vmdesc(void); =20 +void migration_cleanup_json_writer(MigrationState *s); #endif diff --git a/migration/savevm.c b/migration/savevm.c index 8d4bdc28ab..a31f34f25c 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -3404,7 +3404,7 @@ bool save_snapshot(const char *name, bool overwrite, = const char *vmstate, =20 the_end: bdrv_drain_all_end(); - + migration_cleanup_json_writer(migrate_get_current()); vm_resume(saved_state); return ret =3D=3D 0; } --=20 2.53.0