From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569147; cv=none; d=zohomail.com; s=zohoarc; b=fHSGj5kPqzmA+zFylfoylEYltQIW8+HpQXdukiebHScW37Z+FKtnOdXXGesDsjDko9B1fL3bQhJGXF25mR+ZGVhJGuKWiQFkG3Vn2tAVM6xKLJDFrsgRQJ4mliNRxpHxdxZK9Cl3IhHqPF/HtEg5v2xO9L4oU9ugrTgUOZk55z8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569147; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nCEVMD1gyJAzZ9YtCPiB1iMbNGx4Ji4Gb/+PW9esD/Q=; b=ZmTaT9XUzYaWuThYU52iN/McxdbIifdf1hhkVOifN6jezY2iE4+7nYjNzMH2nnyg97hgSPSp9nKfBOzRBnjsl7dPGPEq2/dVI3EYSzYiGDnP6l5Mtf3Ygk2o7zGhx/Zg81fU5bc4UBl2mhK3k84bzHUEcsQNu+autECmvqNz3us= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569147894155.41622279622982; Wed, 21 Oct 2026 00:52:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR6p-0004Tv-LP; Wed, 21 Oct 2026 03:51:39 -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 1xJR6f-0004Qx-BL for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6d-0003xi-1O for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:28 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-62-I0gtOtuKM9yQU1l017bpuA-1; Wed, 21 Oct 2026 03:51:20 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A561F1956070; Wed, 21 Oct 2026 07:51:17 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CA8A41956089; Wed, 21 Oct 2026 07:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nCEVMD1gyJAzZ9YtCPiB1iMbNGx4Ji4Gb/+PW9esD/Q=; b=haEuoVzPfH8C/XA/2pHb16yBUzTBh3e4V7cFbg174/IjVP1FaJgHCoDbxPdkXh2pJsjrsU 0G6iU5vk8LwBMbb4vMAsBxRSno75j/sNsFp+Bm3btISMTPy4QCSpGlUGvVjldz0/wbQV6J DbKgyeySFwBj0AcztkY0zFKgW3eVvuc= X-MC-Unique: I0gtOtuKM9yQU1l017bpuA-1 X-Mimecast-MFC-AGG-ID: I0gtOtuKM9yQU1l017bpuA_1792569078 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:04 +0400 Subject: [PATCH v2 1/9] tests/launchupdate-test: correct g_auto usage MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-1-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Peter Maydell X-Developer-Signature: v=1; a=openpgp-sha256; l=1214; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=B4SuUYDYOYHdj6YNYX9ybX09sSVtBdqWgwmLhNkBr3c=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7szaLzZFlT+NGpkQeDe5xkJ/uFPnT/X/3mX w+qbORERkaJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5ZULEACIUEzGHL2xRgPFJR5ukS8hpXqY8yUD9CDkaHGBz7voRSHecAwzrilUyAaNTVdWIWKmfI8 pUnJBxi1005vXyKgoOZxqz0jPRf5TV91rEgBaKlx0dxFgrGIclUNMUSCoosu0D6QnHEzVHXfKs3 BKI7+Hs2lmlnytkux29Hky4on4/0CpijDJDPK8D6CetzriQlMgyEpQyDysVPDRIa4aEMVrsLYf8 UZSgLhIOfqyhZAB0cw3YjUxywOWzHydUNfqntnn+YPmpcYEhZ0LFwRgDny4KSgsMsh0JGSHK2ex 9+ibZLDXEEs7+IaJaiJB3RjMQRFM+mwFuXx26dHw2XtRTRtGeO+pEvJ5hkm1EGJZuW8o45koPCV Uu9kftGQIHFcLokbB9vHjIjSLPcCUc4Vqqc7UmLxIYBgajI6mw980CS5hlhCqK16MhXiTWJ7Pe0 6B4Wv56y/BeOGEoi8JUXKaX0VJpWFPXnB0cvYjt1HhCXtddzfZrvgfIR4fEqN7U8ruvUNsqumcH 4154YA8cWNfyuQqJTTeVL4yX8RnEp7WytZgeKFrjUlD7FT4B5wLfk7eRbsFMLuv7cUWKhgkZeM8 RhMJsKqf3fhuKQ/I10cvd9GDQe1lGlf+jFp7INrJfV9PsbPEVw+DbDJtlWErmkHvNCj04TdgyUK bk4x3hTjL7TtiNg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1792569148411158500 g_free() isn't the appropriate way to release those types. Fixes: 0b70c6ce7b31 ("Add functional and unit tests for the vm-launch-updat= e device") Reviewed-by: Peter Maydell Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/launchupdate-test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/qtest/launchupdate-test.c b/tests/qtest/launchupdate-tes= t.c index 225c843df5b9..ed007cdce29f 100644 --- a/tests/qtest/launchupdate-test.c +++ b/tests/qtest/launchupdate-test.c @@ -192,8 +192,8 @@ static guint32 match_string(char *serial_f, const char = *exp_out) { GError *error =3D NULL; g_autofree gchar *f_contents =3D NULL; - g_autofree GRegex *regex =3D NULL; - g_autofree GMatchInfo *match_info =3D NULL; + g_autoptr(GRegex) regex =3D NULL; + g_autoptr(GMatchInfo) match_info =3D NULL; gsize len; guint32 count =3D 0; gboolean ret; @@ -214,7 +214,6 @@ static guint32 match_string(char *serial_f, const char = *exp_out) g_match_info_next(match_info, &error); count++; } - g_regex_unref(regex); return count; } =20 --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569175; cv=none; d=zohomail.com; s=zohoarc; b=N79XpWADg4CYrh4gqeH2/gPock0tDKPygeRp/TU5Vz1JrYw1QWR6fkvkZyo8ptz/B0h1aHRGAnKJVxc7Iuzpu3vrZ1CnbGEmslKkIAytLg9f2zjeuu/ieIfPTNLpjP2k14XyEwNAyelMgSS2aGbvXSKj27Y4e7nRSy+/iwbSfEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569175; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=unQXSTQTZoQiah9mbg1f2OYCq0ukmOFPU3aCLL6PWvQ=; b=Ij6SlMyn1EKCwTYXSFPrRZ3K5iYf/EOv6kABA41Qk/tOoNqH6XgN3hnBLnv8Nz+TDnsZVhgmSYRXvY6xstwRcNpEN7eog8E92VeqAADyHNkl1Z5D7l6Z512LNg0M7tl8q00xEF2NUWKW3WOY3O5CCp1cP8QTX4dvDf5nMe7O2eA= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569175672569.5566121100549; Wed, 21 Oct 2026 00:52:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR6r-0004Vj-0p; Wed, 21 Oct 2026 03:51:41 -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 1xJR6h-0004RK-Tv for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6g-0003yr-Fn for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:31 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-464-XnTlfqXjMwmnDWaDKvpY5A-1; Wed, 21 Oct 2026 07:51:24 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9A78B180064D; Wed, 21 Oct 2026 07:51:21 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 734B330001A2; Wed, 21 Oct 2026 07:51:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=unQXSTQTZoQiah9mbg1f2OYCq0ukmOFPU3aCLL6PWvQ=; b=K1JjE3CfPKys5fdD4WtyfskYk1Sltq6c+z+dqsqAErdSul8IgV5qqG2c+UuZ0vI+VZ6/zs KlaP16vSBSVo7OPD6aRZvSPSF0Ic+DcSWTPGrOejrzBgBbjcQ3j2mZ5goayhu0ZQAr+/Io IIBFuEmmMzNjvETLUwvcnfLUrrZ99Ew= X-MC-Unique: XnTlfqXjMwmnDWaDKvpY5A-1 X-Mimecast-MFC-AGG-ID: XnTlfqXjMwmnDWaDKvpY5A_1792569081 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:05 +0400 Subject: [PATCH v2 2/9] tests/launchupdate-test: correctly release qs MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-2-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Peter Maydell X-Developer-Signature: v=1; a=openpgp-sha256; l=2849; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=SIfxG9op7mrpLLVcQw4l/GNNVlnSFKeBptsXHMfpnlE=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7ssrjdpIfQxNqb8GB1qHQUrvuifcFC4Nik0 laK5ASM0M6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5Z9NEACgHeZuxkJfxl8LhFzTBAsyNexcoR9fBEdEtTmXScmqg9++kdgPnPsRb80NsVSvpjUb45u a2U6aeZ25zg3zuAfw4hrrKjPFITOYENl8DEIWplr5Qvd+ooujOoaZtBMsWPX3oqwu+leLhhHJsm 3MFsO5oxjOQYhUTcVVHooJ1myWVOBHy0AnyoUTpuXnN9KM8p2H9C8ufXSRxKnSTEoiKqtKQz5gr NKTtUyBARmOFD2fOMwafVH/qQKt+Gso+bup/AfKWUXCu63ATF/mw50LdSxE549+92xhotCPCJSE vyoi7P5Nku7TJV6XXeP7uHss7WqPQxBwaJVXZbFa63J8UVM7BbXhu218fdD+MiH/NdBn58EYdgh wVKQ0Ob41PlgxUGLDz8RXDKLYS5bdX57bPo2gtGK1qqZrYMQ0xzsIctwH6ErGyJ+ATIo6M7qtyc +3Ekds0ONCxxUpi2qc6yX4jiYcH4i+iRV/Eo/OzqfWOFWRombSCSM7Y+kALH1IxMRG3nVJq37Fk Haz39uw4drkbpDD28wabrqg+8D6h8BftTwdNkOXtD67iGCfakOw+ZN+8TTUn1Krz0nFqyCRwSHP yzTC3upqQQMSc+xb5LbPilWJUFK5WOWhaNFanv41+mdYNi0tJL86vKHXcW7KA3FPqQbjidM/cLk HDociaZoJ8KRe5A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1792569176862158500 QOSState must be released with qtest_shutdown(). Fixes: 0b70c6ce7b31 ("Add functional and unit tests for the vm-launch-updat= e device") Reviewed-by: Peter Maydell Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/launchupdate-test.c | 13 ++++--------- tests/qtest/libqos/libqos.h | 2 ++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/qtest/launchupdate-test.c b/tests/qtest/launchupdate-tes= t.c index ed007cdce29f..ea35da81feb9 100644 --- a/tests/qtest/launchupdate-test.c +++ b/tests/qtest/launchupdate-test.c @@ -51,7 +51,7 @@ static void test_vm_launch_update_capability(void) static void test_vm_launch_update_disable(void) { QFWCFG *fw_cfg; - QOSState *qs; + g_autoptr(QOSState) qs =3D NULL; VMLaunchUpdate launch_update; uint64_t control; size_t filesize; @@ -95,13 +95,12 @@ static void test_vm_launch_update_disable(void) g_assert_cmpint(VM_LAUNCHUPDATE_CTL_DISABLE & control, =3D=3D, 1); =20 pc_fw_cfg_uninit(fw_cfg); - qtest_shutdown(qs); } =20 static void check_error(void) { QFWCFG *fw_cfg; - QOSState *qs; + g_autoptr(QOSState) qs =3D NULL; VMLaunchUpdate launch_update; uint16_t status; size_t filesize; @@ -326,7 +325,7 @@ static void test_load_igvm(void) size_t igvm_sz; size_t filesize; QFWCFG *fw_cfg; - QOSState *qs; + g_autoptr(QOSState) qs =3D NULL; VMLaunchUpdate launch_update; =20 if (!trace) { @@ -456,8 +455,6 @@ static void test_load_igvm(void) close(ser_fd); guest_free(&qs->alloc, gaddr); pc_fw_cfg_uninit(fw_cfg); - /* qtest_quit() kils QEMU, first by sending SIGTERM, then SIGKILL */ - qtest_quit(qs->qts); } =20 static void test_set_ctrl_once_and_reset_to_host_igvm(void) @@ -475,7 +472,7 @@ static void test_set_ctrl_once_and_reset_to_host_igvm(v= oid) size_t igvm_sz; size_t filesize; QFWCFG *fw_cfg; - QOSState *qs; + g_autoptr(QOSState) qs =3D NULL; VMLaunchUpdate launch_update; =20 if (!qtest_has_machine("q35")) { @@ -585,8 +582,6 @@ static void test_set_ctrl_once_and_reset_to_host_igvm(v= oid) close(ser_fd); guest_free(&qs->alloc, gaddr); pc_fw_cfg_uninit(fw_cfg); - /* qtest_quit() kils QEMU, first by sending SIGTERM, then SIGKILL */ - qtest_quit(qs->qts); } =20 int main(int argc, char **argv) diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h index c04950e2b19d..b2d02825a9af 100644 --- a/tests/qtest/libqos/libqos.h +++ b/tests/qtest/libqos/libqos.h @@ -42,4 +42,6 @@ static inline void qfree(QOSState *q, uint64_t addr) guest_free(&q->alloc, addr); } =20 +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QOSState, qtest_shutdown) + #endif --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569183; cv=none; d=zohomail.com; s=zohoarc; b=GeZQ6r2QqvVJ469RJLoqhh4AYS4CniEgsmSltv5kUSnjRQuXdYoT1nKO+pZ1qZXc4kVX6OsuCPUnFMb7FpNAgf+tOlhV/2T8cptpNyzTV5EUBfd0ZDuxVtcbmqixgA/OrwmDq6BRfEcHzMTHJ7qerh1G7kxVCRQ60ihzEH71T9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569183; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DWiu4rdH5d4Ohomxfbbk+J9JlwPMqxTLl3rEhWFpI9s=; b=LTCnbTGukeo21OqsIaPrP3YBqUqbfpWw8TSfvlDWuhmk08dMMyE3cIavTsO8cGtB4AOgS9QqjS2otpc6yzkXdfl8RFj3d9YNwrTJC/je3YQSBopirC7oLnPfeILTT/XcK6cygS6+27sn0aE++ew11TafIKTbizWkydAio/nirWE= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 179256918349655.61699193005086; Wed, 21 Oct 2026 00:53:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR6r-0004WP-Fi; Wed, 21 Oct 2026 03:51:41 -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 1xJR6p-0004TX-2I for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6n-0003zq-KY for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:38 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-336-6YvJ2dskO-yPHklQrKmoDw-1; Wed, 21 Oct 2026 03:51:27 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5D5BF1800591; Wed, 21 Oct 2026 07:51:25 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E9B351956087; Wed, 21 Oct 2026 07:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DWiu4rdH5d4Ohomxfbbk+J9JlwPMqxTLl3rEhWFpI9s=; b=IZudDU2OrPikMADmgxVi/TmMfZN5/VAm9Av/K/dHxvVxRMIDFG7HmLfFazdVe06NiaB+lN a4qhfkYJ0J3Xrt38bkGPuxSKtu7Mfg0Vbdsmvjduf5jKHcEFepvG42q1oetEExc790Ydte k3kM4utOhc9oYc/VwF6HNDYLjjX48DA= X-MC-Unique: 6YvJ2dskO-yPHklQrKmoDw-1 X-Mimecast-MFC-AGG-ID: 6YvJ2dskO-yPHklQrKmoDw_1792569085 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:06 +0400 Subject: [PATCH v2 3/9] tests/launchupdate-test: fix fw_cfg leak MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-3-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Peter Maydell X-Developer-Signature: v=1; a=openpgp-sha256; l=761; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=X2HUHDf+UkIywAf5xGFW5GDIxuTg6SMnnUvGwLSGYRs=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7sXbtCZ6+VoA/0Wt2VQCZ+7zXD8JHy97dAF TQO8c6oi3GJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5Yv5D/9eB20Pqh+b/Vly4fLmJw4wWIRRV6op3zTdvQgrql0Xp+XU1JvanBIQGBVaRkyPJLnMXS/ Rk9vSraxN2sXe5LFyw4pl5F3ICgcY/Z0Y49G0RcG7P/cLCkbuqBCLKpPnV4LUQ2NXdaONlR/qLf FHDrNrpIpUnekTzXsEuPnB9GwJFwz6VVLIUYUBdGfr0sekxmPErR2DeF+Fs4ELc1SZrXTTdUjXW oMiUB2zu6JsTWH7UAU2ITjknPiQdg2rYeijSO0FF0ws7VL3UR5qIIdzuT0huYUpHhS4XNexrI0B Qg8UukrlSPGHvnubsk9dZ7kjSFM/9NncZgk1euonwoDUWNyONSZM9Zy2VGC8LhN8tNLGHeP68Sf RkxmqPkYauaa6FQTDM/KjDRwp3TNpvZRVSK9EfYt9O33yFatmSLPFDB0EAM3LTobzjNcIH1iZRr lP5oAJzxhbRBySH2yRwM9VuxcVAPAWYUtVdLpqSQ7BmtyOLvwKJ73ZcdlDhCNIishhb/2FX72rs 51gxbng1RZ4vtgsI+hXROf+slPDw0o+7DKXWwIjTJljV+SZxnUEDNlzJsFAXepnAgrJa64yejxr panEvvphD0jIiMhizgspzEIqSbFgQZU8vwBl10iL2nf5l2fQt+wqwxv08d2EihvEwwhNsaUDeaQ zhFNmHCfM3wvQ9w== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1792569184994158500 Reviewed-by: Peter Maydell Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/qtest/launchupdate-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/launchupdate-test.c b/tests/qtest/launchupdate-tes= t.c index ea35da81feb9..beec902caa6a 100644 --- a/tests/qtest/launchupdate-test.c +++ b/tests/qtest/launchupdate-test.c @@ -148,6 +148,8 @@ static void check_error(void) status =3D le64_to_cpu(launch_update.status); /* should fail with LOAD_FAIL since it was not IGVM format */ g_assert_cmpint(status, =3D=3D, VM_LAUNCHUPDATE_LOAD_FAIL); + + pc_fw_cfg_uninit(fw_cfg); } =20 static int64_t get_image_size(const char *filename) --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569174; cv=none; d=zohomail.com; s=zohoarc; b=YfAbIeLbViDkbgNXphglp6beRnud5wPH9xZA74/MVEx4nYCbT4TtE9lXlQmpZQDlqFnbJ4mpbMhMopms2JLjK8LcOXaqrAfDdiwXIQhx2HhuQUupOX5E58OPl9QS41kZiAKXMOP4gjyZvX/X8Md9dWz/YGCOBsXhcCpCtIV2xbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569174; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2DO8OeMb+C+EUDoAt5gPWzSeCXRyILLDCf3aXuMCRFo=; b=VkDRAzHxYMH3QiW3HltBxndvUg42PjCDsnmSibqWmRr9jnk3EVtaSPoVCZZa1ohbHtMiRlYIb5TC/LdyYMQrj+d1yLeEEFgwbgFHJIw5AtSruiev+DMSDUeTu9DAn4U032As3SHlhxwjtquz00MgINXgpYPdm9Lqrl0emsTMifA= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569174771615.7287095083367; Wed, 21 Oct 2026 00:52:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR6p-0004U0-QY; Wed, 21 Oct 2026 03:51:39 -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 1xJR6n-0004SS-HJ for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6l-0003zM-BJ for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:37 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-kmyb-YKPNVutpIxs314zTg-1; Wed, 21 Oct 2026 07:51:31 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F27E71955F61; Wed, 21 Oct 2026 07:51:28 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2451E1956088; Wed, 21 Oct 2026 07:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2DO8OeMb+C+EUDoAt5gPWzSeCXRyILLDCf3aXuMCRFo=; b=i2i8ijVNP4pjLqLfmQ9EQi9vkhsG5YruCoSBZ9Nmz2dKc73O2bIWvQTWlZ9WDso9I8+elI 5scLU5+s3k1a1K7G6OjRbwJTyYz0tHiQswo4lDiccEXb509F4WwUcKv5tJk8fUHHS15YUj s22hIevIUClhR0n0JzV7pcHYK3GpTlY= X-MC-Unique: kmyb-YKPNVutpIxs314zTg-1 X-Mimecast-MFC-AGG-ID: kmyb-YKPNVutpIxs314zTg_1792569089 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:07 +0400 Subject: [PATCH v2 4/9] igvm: release found memory region on success MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-4-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=821; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=wBMEnCG6NX/SrNvdiEREVxq3Y1p2VuUlUjKNL1jFJqw=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7svaHG4HKe964hg4gbghz1LJx4EFl6HrRR2 Oh8CM7g0zWJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5TpvD/4yU3ApEJRs8JEtgCJ7s+haeWhGrUjS0UzaO2B8R3E1uVb014cbSgThx4vGrTAxgdOY+WO D2czUsOWyI467vewnw8zLmxyHLtumuHek0gNvh/4Ecki2QEpiSklerjac4orYoavBBNJjVE0z8w yyWMq+44Ram1YqA0VqNOmJDRAdgQpZu8sI5uanenojxIHTfgTUVaOcInVp6kZAnKJAZh8+O+uNz NxecSHmySQE2aL3ZUtu/F4n44hoWvj19xeck3HezXvH36Kihc4dpI6197RL6Vd1GYg+jUiChsOX xieRMgwTKoFw/A4P2Ub97SPSA9t9U1tPdvIN4SKuRVI9Te0fgaQWUXojPoLNFG3W+vz+L7JVNFc zzOpEE1qGKssbMzJEJonMn+Ywh4zjXVVPqNyJ+Yu5ZURIZB0XaoCMVm9RCK0n/BiZB+fT8dcn8h 2ScR/PRN6V6QDn937PWVzfEbSnYmgd6oSNo+6Nz1WhA82F/H0OYD0fvrvf43eaYsDklFKoUzbXz uDHADz1E20h/tnzqYSRXkrccUj770K0D5ym5dCNGU/AUAMOmcHyGx7KRO3NnQ2MPOWO07x+C+jV 4RTvNeqHLaAClo5GCq1Oviy/PP9MhcNx7JYWw7AgMlnXNXcVYa40oyUrbARmJPYFrk2iAyTW9YJ uYdffsM4D7F9hgA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1792569176867158500 Not only in error paths must the mrs.mr be released. Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/igvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/igvm.c b/backends/igvm.c index 58f3097e8518..7aa76441d0d0 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -268,9 +268,9 @@ static void *qigvm_prepare_memory(QIgvm *ctx, uint64_t = addr, uint64_t size, return NULL; } =20 + memory_region_unref(mrs.mr); gpa_region_size =3D int128_make64(size); if (int128_lt(mrs.size, gpa_region_size)) { - memory_region_unref(mrs.mr); error_setg( errp, "Processing of IGVM file failed: Could not prepare memory " --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569146; cv=none; d=zohomail.com; s=zohoarc; b=HZeZ+zj5xkE3wXpcOz0da60ARHETi5AhiWmRgZQHz3NASp5Sz2UIcDU/wOpXU20giSJRtWSidbY4yE0lfG5DkfLSW7y/oZRiKCJRIIuFnuKr8E5VseUpFyoC8ABcbMk5Xxm8o0tKlkaiqPQOBztDyUcwT+WlICPkSat82f+9mSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569146; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/1fjiWygkRwux1lBwCGtl1AUmo2UCIH9Jml6qaPzOWQ=; b=njgm6QmHvONCqMhbF1gYDfUUoXY5+SO9bp1X28LYdzg2/ZL2xzhbXP4c9/z/XhWeWHMwyoeADgkzEIN1mjFDrhx/cQzYmUc4c8EOmTxj6k2UgTK3EDmVdcEP4i8e3d44AyJnXua0/TcbjcIyeeKTT6H1CnbXk84+Nf9jl2oKTIo= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569146799475.7013032983248; Wed, 21 Oct 2026 00:52:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR6z-0004ZC-FH; Wed, 21 Oct 2026 03:51:49 -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 1xJR6q-0004Uy-NM for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6o-00040E-Q2 for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:40 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-DnuOtDtqNgORIwumhtiG0Q-1; Wed, 21 Oct 2026 07:51:34 +0000 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2A9AF18004D2; Wed, 21 Oct 2026 07:51:32 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 527761956087; Wed, 21 Oct 2026 07:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/1fjiWygkRwux1lBwCGtl1AUmo2UCIH9Jml6qaPzOWQ=; b=El8VbrgMfZgx0nbV+WbppWsOnkzcwH+g3TA3z1wL/CPkEmOHxGqNP4qgCDMWhpOjX3Dapc 4ZcLDVkTD/zHgqzxYEItfl4Fiv6+14e8CXFNm1fByoEKxOWwqalQgIJJUP88m9VwqK6CQn o/ojCPWIk4RXrHH4rLxlr7jlP1Y3HLQ= X-MC-Unique: DnuOtDtqNgORIwumhtiG0Q-1 X-Mimecast-MFC-AGG-ID: DnuOtDtqNgORIwumhtiG0Q_1792569092 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:08 +0400 Subject: [PATCH v2 5/9] igvm: make IgvmMemoryRegion a QOM MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-5-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=6350; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=U7m8WDF/BAK2Wf3yksj4Ah1D/30tnscuRyK47dRWL0M=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7sE/NDYU0dPsL5ZmSwgzvYHLtsaqJ5dmJ4i YVhI027KruJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5Vd/D/wI83FAMNZzitfee4XKFjd2MuZ+E2e0GaAE1uttvlOUUjqgPLi4p4EjM/uIS3yMEI/V7ZN jLy0lsnQRN0RLyIONJsoyOzOBJYu4cVwJw2WL2EgdYF4Ch+fCuA7pb3F+/te5ca33vc6j6ecqpT 9Jkp1mgn9aTrXzl4YxeqDzRxSPvCjVjDP3bj0t1KhRu5SZ+xv45jKVhfpLY5ixhcgIV/e1Ka4wR X3YDk6RuiDtIhHJateny+ainTkS+DY71jvCgrAcixWthKDnhws3xa/d0jMTzsC1bfe4mhyQzLRr CUFsNDDNUEsfaWqQSp78N4gHSuQRfglNAHeE4HO/QONZn3qwOF5duZY6Hc5JC4kIXwyqdPhGbEl wTWn3xdaqZl5TGN8BFyVWngMlZ3f1mC5ZUGx0CaHyc0Pvh3D/7QdTjp6jbVfWKE4BfbkdjYlA+I A33WwCyOPg4qwiy12QkMf0I6ndufa2dlb/7u0JXdjATQ4BNYmvvApqlffRTkqszyYmLuQW0v054 tDRYPFUFB1wq3kmysNDybY64mIzhW1q8NrWztOnr6XdBc6I/NMxlabFq1XV+Z3BMPWDUy+/Wn3a qavvR1jCu4iqmXUFAd0fyrOUp2ecmhKTEIqOc/lLlvno3RV2be6Ahd3dkYkW/mmeaMDKTg5SryL fQGXa/egj7lA1tg== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1792569148487158500 Make IgvmMemoryRegion a QOM object, embedding MemoryRegion, and use it as the region owner. The IGVM list and memory subsystem can now hold references independently, and QOM frees after the last reference is dropped, fixing leaks reported by ASAN while running tests. - object_unparent() is no longer needed, children are automatically unref - switch to memory_region_init_ram_flags_nomigrate() as other helpers expect a DEVICE Signed-off-by: Marc-Andr=C3=A9 Lureau --- backends/igvm.c | 97 +++++++++++++++++++++++++-------------= ---- include/system/igvm-internal.h | 9 ++-- 2 files changed, 64 insertions(+), 42 deletions(-) diff --git a/backends/igvm.c b/backends/igvm.c index 7aa76441d0d0..e659fea25517 100644 --- a/backends/igvm.c +++ b/backends/igvm.c @@ -35,6 +35,12 @@ #define IGVM_VHT_OPTIONAL_BIT (1U << 31) #endif =20 +struct IgvmMemoryRegion { + Object parent_obj; + MemoryRegion mr; + QTAILQ_ENTRY(IgvmMemoryRegion) next; +}; + /* * Bit 31 of the variable header type indicates that the header is * optional and can be safely ignored by a loader that does not @@ -253,10 +259,13 @@ static void *qigvm_prepare_memory(QIgvm *ctx, uint64_= t addr, uint64_t size, int region_identifier, Error **errp) { ERRP_GUARD(); - IgvmMemoryRegion *imr =3D NULL; + g_autoptr(IgvmMemoryRegion) imr =3D NULL; Int128 gpa_region_size; + g_autofree char *region_name =3D NULL; + uint32_t flags =3D 0; MemoryRegionSection mrs =3D memory_region_find(get_system_memory(), addr, size); + if (mrs.mr) { if (!memory_region_is_ram(mrs.mr)) { memory_region_unref(mrs.mr); @@ -279,36 +288,29 @@ static void *qigvm_prepare_memory(QIgvm *ctx, uint64_= t addr, uint64_t size, return NULL; } return qemu_map_ram_ptr(mrs.mr->ram_block, mrs.offset_within_regio= n); - } else { - /* - * The region_identifier is the is the index of the IGVM directive= that - * contains the page with the lowest GPA in the region. This will - * generate a unique region name. - */ - g_autofree char *region_name =3D - g_strdup_printf("igvm.%X", region_identifier); - imr =3D g_new0(IgvmMemoryRegion, 1); - imr->mr =3D g_new0(MemoryRegion, 1); - if (ctx->machine_state->cgs && - ctx->machine_state->cgs->require_guest_memfd) { - if (!memory_region_init_ram_guest_memfd_private( - imr->mr, NULL, region_name, size, errp)) { - g_free(imr->mr); - g_free(imr); - return NULL; - } - } else { - if (!memory_region_init_ram(imr->mr, NULL, region_name, size, - errp)) { - g_free(imr->mr); - g_free(imr); - return NULL; - } - } - memory_region_add_subregion(get_system_memory(), addr, imr->mr); - QTAILQ_INSERT_TAIL(&ctx->cfg->memory_regions, imr, next); - return memory_region_get_ram_ptr(imr->mr); } + + /* + * The region_identifier is the is the index of the IGVM directive that + * contains the page with the lowest GPA in the region. This will + * generate a unique region name. + */ + region_name =3D g_strdup_printf("igvm.%X", region_identifier); + imr =3D IGVM_MEMORY_REGION(object_new(TYPE_IGVM_MEMORY_REGION)); + if (ctx->machine_state->cgs && + ctx->machine_state->cgs->require_guest_memfd) { + flags =3D RAM_GUEST_MEMFD_PRIVATE; + } + if (!memory_region_init_ram_flags_nomigrate(&imr->mr, OBJECT(imr), + region_name, size, + flags, errp)) { + return NULL; + } + vmstate_register_ram_global(&imr->mr); + memory_region_add_subregion(get_system_memory(), addr, &imr->mr); + object_ref(imr); /* for the list */ + QTAILQ_INSERT_TAIL(&ctx->cfg->memory_regions, imr, next); + return memory_region_get_ram_ptr(&imr->mr); } =20 static int qigvm_type_to_cgs_type(IgvmPageDataType memory_type, bool unmea= sured, @@ -1161,14 +1163,33 @@ void qigvm_cleanup_memory(IgvmCfg *cfg) { IgvmMemoryRegion *imr, *tmp; =20 - QTAILQ_FOREACH_SAFE(imr, &cfg->memory_regions, next, tmp) - { - trace_qigvm_cleanup_memory(imr->mr->name); - memory_region_del_subregion(get_system_memory(), imr->mr); - vmstate_unregister_ram(imr->mr, NULL); + QTAILQ_FOREACH_SAFE(imr, &cfg->memory_regions, next, tmp) { + trace_qigvm_cleanup_memory(imr->mr.name); QTAILQ_REMOVE(&cfg->memory_regions, imr, next); - /* this triggers MemoryRegion cleanup */ - object_unparent(OBJECT(imr->mr)); - g_free(imr); + object_unref(OBJECT(imr)); } } + +static void qigvm_memory_region_finalize(Object *obj) +{ + IgvmMemoryRegion *imr =3D IGVM_MEMORY_REGION(obj); + + if (imr->mr.container) { + memory_region_del_subregion(imr->mr.container, &imr->mr); + } + vmstate_unregister_ram(&imr->mr, NULL); +} + +static const TypeInfo qigvm_memory_region_info =3D { + .name =3D TYPE_IGVM_MEMORY_REGION, + .parent =3D TYPE_OBJECT, + .instance_size =3D sizeof(IgvmMemoryRegion), + .instance_finalize =3D qigvm_memory_region_finalize, +}; + +static void qigvm_register_types(void) +{ + type_register_static(&qigvm_memory_region_info); +} + +type_init(qigvm_register_types); diff --git a/include/system/igvm-internal.h b/include/system/igvm-internal.h index b3b64cb58444..c2ceb57ffa65 100644 --- a/include/system/igvm-internal.h +++ b/include/system/igvm-internal.h @@ -18,10 +18,11 @@ #include "system/confidential-guest-support.h" #include =20 -typedef struct IgvmMemoryRegion { - QTAILQ_ENTRY(IgvmMemoryRegion) next; - MemoryRegion *mr; -} IgvmMemoryRegion; +typedef struct IgvmMemoryRegion IgvmMemoryRegion; + +#define TYPE_IGVM_MEMORY_REGION "igvm-memory-region" + +OBJECT_DECLARE_SIMPLE_TYPE(IgvmMemoryRegion, IGVM_MEMORY_REGION) =20 struct IgvmCfg { Object parent_obj; --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569147; cv=none; d=zohomail.com; s=zohoarc; b=fPufqSdiNBgObWoPBCB93Ofoy3BwCzz4i1WS0tNwbJ1WIL2I+i19LosNb3Mmrs84GEUeVnV8snd37Am87xbHRs6aoXPkG5vFWPuZpOotMt//e4i1xjaveVD23jMSV+qSP+6oXyfl3P9D0kbTA1IaHKQTeMHw7Wh11IEFWcncaWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569147; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XAMi0HrTLKQqtXBzHsADAyOWxkdskHxLY/vBFknjMN4=; b=dGBF9Ad9ZxBcZ0MIk58uA/EXZ2Y9kDuLRKks6GHnBgUzEo3PkTIwcgQKpf7l9qznUWK7y/c4tVWXb6IZzOuFEJvMfHtVyVEmGIlRg4BYYV+L54DsenTS4BXY5mVJbjsOhjqIHemDqOa47ffp2y5WQrk0fuX/9ZGXqEjIWcdeT+k= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569147028588.1448464681397; Wed, 21 Oct 2026 00:52:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR70-0004af-Qp; Wed, 21 Oct 2026 03:51: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 1xJR6s-0004Wz-MI for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6q-00040p-SJ for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:42 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-202-lvaGCU9QNZevfRV9mCbskA-1; Wed, 21 Oct 2026 03:51:38 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1E551956088; Wed, 21 Oct 2026 07:51:35 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E98DF1956087; Wed, 21 Oct 2026 07:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XAMi0HrTLKQqtXBzHsADAyOWxkdskHxLY/vBFknjMN4=; b=CY3a1oCYZK4q7AMihGkj4AlQZSRn10ovVQZfCil8Q3tGBEBy8HDQg8eGROOd3kZgXoor5h xKksRHqcmTdwvKYOHdZ+6cTaO6ESpZZyCmNDBjOJTn+7hLGRw5TbZqh2O4ZyMuaopeemcc a7cSesRStYI/Hb0e/+wzkVAuMbzSo6w= X-MC-Unique: lvaGCU9QNZevfRV9mCbskA-1 X-Mimecast-MFC-AGG-ID: lvaGCU9QNZevfRV9mCbskA_1792569096 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:09 +0400 Subject: [PATCH v2 6/9] hw/s390x/ipl: fix short SCSI loadparm buffer over-read MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-6-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1872; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=F2rHJNlR/CFS/VceTNWL7HfX4e29ttJ+I9Xyczh3VNo=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7sNdknHjQDE5zAK6n+oA3mbgkrUUJPTfTQi KWQ7ygeqJiJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5VmTD/4w/liODXHdeLWQ7OW83j9L9qejjPwJzRxjNBoFxr6i05Rh6NJoigiEUHSLZ2vanvNZKlv T/AHxf+I4v0twr+wV7OtOFpRhYZ+uW3XL5AVycBcoXhQiR2ERK76TCsD/TqISuBeE36qMDvhnQe diRrjEghVL2XpvDzg7/aCnVUObbzJE338+LZ4uwBOqVCbvb6hEhZGIXZoh3tOq1y1SYVUBNTms4 Go7EmNKXylykmUY3hKPP0Y+ObNDnrXvvBujbk3D7RlOTdj/Lj3MbGwFZ5jdGEy9HwLAz1wSzanj S8rrraMDc9+1oYqafjBmHIQKXkvP4T4OK/bCTG4q9oxospeZQ8WwCAEKtVPsBwc0BN/YBuGJ6iM uMpnVKrpvO3vNGP4CiALeUskVMcBaTZ74UPT2BOQm+Fq/qzoGSfvXPwL3gDhBYCjVXZtrFpklaU BgCgdPx7ln+theCK9oRCMR9AGISlvEOn3AFzBBJo6qDKHfACPqIwHPZbtpOeuuEEreYqpa3uOWL do/oZzsW2cnblJUIFJvoehsRy79mIjRCURSeDj5VpyC75ZG7Jp8IABlunnW7ApTbSMn+Kaw2Fe2 c9BkX5/O1UqcOVAmxS16tsGAQcEnKIazbmwcgzdWrf4xYyzPZsXyWGPg1DC8/Zbncl3V5mrOE97 9c4zwXYp650dV7A== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1792569148426158500 s390_build_iplb() initially points lp at the eight-byte CCW loadparm array. For SCSI devices, it can replace lp with a variable-length string returned by object_property_get_str(). The following memcmp() still reads eight bytes. ASan reports buffer-overflow on value "3", when running test_scsi_loadparm func-s390x-boot_4k test. Check the fixed-size CCW loadparm for the 8-zero before the SCSI property can replace lp. Fixes: 429442e52d94 ("hw: Add "loadparm" property to scsi disk devices for = booting on s390x") Reviewed-by: Jared Rossi Reviewed-by: Eric Farman Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/s390x/ipl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 1add11ad7b2c..fe107af84de0 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -570,6 +570,11 @@ static bool s390_build_iplb(DeviceState *dev_st, IplPa= rameterBlock *iplb) if (ccw_dev) { lp =3D ccw_dev->loadparm; =20 + /* If the device loadparm is empty use the global machine loadparm= */ + if (memcmp(lp, NO_LOADPARM, 8) =3D=3D 0) { + lp =3D S390_CCW_MACHINE(qdev_get_machine())->loadparm; + } + switch (devtype) { case CCW_DEVTYPE_SCSI: sd =3D SCSI_DEVICE(dev_st); @@ -605,11 +610,6 @@ static bool s390_build_iplb(DeviceState *dev_st, IplPa= rameterBlock *iplb) break; } =20 - /* If the device loadparm is empty use the global machine loadparm= */ - if (memcmp(lp, NO_LOADPARM, 8) =3D=3D 0) { - lp =3D S390_CCW_MACHINE(qdev_get_machine())->loadparm; - } - s390_ipl_convert_loadparm((char *)lp, iplb->loadparm); iplb->flags |=3D DIAG308_FLAGS_LP_VALID; =20 --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569201; cv=none; d=zohomail.com; s=zohoarc; b=UA5xTrTZxR4pz19dZrzEGQozvdPF+k6EovRWyfMb6q1Q+pZJqX3v069EQxt5cpM4LWvLS36qb3TRcv358Y4lxw4jtzJLz6MbBwW/P3m9NbR6AtgQJcIVj1AhEM4e3P4/MeZEh38Rk9P3/ppEhtjmZerKGQ9Hp9J584EKk97V4Sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569201; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v1Vvc89dWzjddQWEvB+SAhvAwuborhpZwqfyKsRr2No=; b=Nht5M1YNdqkO/CfmtI/fSPxXTWBxAMl/47inBiFCVTVFHtYrP/HVJP4xakjIrW2syNRzg/ESkbq2GqVIGN2hUzGn0A/AjPIxGpImS83DpfCjmkrx4nNTynAUoDI79HkaQ7CDX7bfildO7VJ45lRKkpTbBvrK9daptTkvapwwuzw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569201013571.9312986218747; Wed, 21 Oct 2026 00:53:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR71-0004bX-Bv; Wed, 21 Oct 2026 03:51: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 1xJR6z-0004Z9-6T for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR6x-00041x-Mi for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:48 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-424-J_UKWlHOOxCSWqJz-EQisQ-1; Wed, 21 Oct 2026 07:51:41 +0000 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 757651956095; Wed, 21 Oct 2026 07:51:39 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2E05C1800347; Wed, 21 Oct 2026 07:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v1Vvc89dWzjddQWEvB+SAhvAwuborhpZwqfyKsRr2No=; b=XfQ0HvwHWyqDYzWIFScYzX5yKbF5eHaqojBvrIEUKidi8WEpy4xzwgG4k2XZjlzQf4dQ0G EsKm/tKici4TQQEy7yeD2XYlG9SSGT48rICCJYZ9M8YZqc+WqwO8bH7SzpwlBkb6GEzDEO zwhZDVREtImGoLdGivxR+njt33HbqMI= X-MC-Unique: J_UKWlHOOxCSWqJz-EQisQ-1 X-Mimecast-MFC-AGG-ID: J_UKWlHOOxCSWqJz-EQisQ_1792569099 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:10 +0400 Subject: [PATCH v2 7/9] glib-compat: fix g_autofd fallback warnings MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-7-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1106; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=S/T+qztE78a5HF46eJleJDNJF6GJp7oWwfHRiLJi8EU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7s2aRy3cKHprCAunT4Sav0yB4j5d6C8DHL/ Itdy3TwSByJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7AAKCRDa6OEJdZac 5ekYD/9jCBW37kP3DlmYA7pO1N35QHDCm40u8WeRXJylWytzilN/mBqR5MQpxNysBaKma98Mfz+ jRttfyBNW90Pv9LvU2shJNnqNU3M7j2g92jgMtFE4+WFbzVD8ugWFgIVLzz9elJiqyg8zOj4TM1 sg9AXJ8Zg7bSm9XlTTYTDBP7J7inK0ih96e60GRfmInjlHl3S1bmQ8AIHMUmjSqfL6CGEQ/Z0Tm 5lxV+1b0L8GY4eGYYifDsLcuE/w3Kq/hFbvnxhBkPHFOTFR/GRlS+TeVctfaZP26+LWYQeQlYrD cFpLMguYUqVK4m8J+C5bbG+S7j1A9PITyzmN76MlXxjmrUQwfl9xLrilsoNTWv1SeFU302678+7 6cLPkZeER05aEA4KuK06PnrZiQN7a8uTT2YQNBgZc9ViJca2/NCXtXmni21HcZxPgn9ObB/tVaC KvAkzIavrg13lYLwQs58A+yv4pVX1jJsLqh8ZLvkpI5kArvJv04hHn3K1WIPAaZm5v71bxPoT6w 2G0YCtQio4PfiD2LcYae7gxz0T+mLewhPDffau2nKiz7XzI9SCcUeMDnoMfyRlaWdq4lT/OVKmU UjuMmXs3h7frViU8pnpVIHyYtyqz9m3gFLDGm2zoNt8HeIulpmNfkL9yn+HXuS8QXWy/1uCP7DG zFSkXpXIuM2eRvw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1792569201436158500 The g_autofd fallback is warning because it uses symbols from >=3D2.66 Fixes: 1599015a7a1a ("glib-compat: add fallback for g_clear_fd/g_autofd") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Alex Benn=C3=A9e --- include/glib-compat.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/glib-compat.h b/include/glib-compat.h index 32ee2afdcdf5..dd6f062f5a43 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -148,15 +148,15 @@ static inline gboolean g_clear_fd_qemu(int *fd_ptr, G= Error **error) } #define g_clear_fd(fd, err) g_clear_fd_qemu(fd, err) =20 -#if !GLIB_CHECK_VERSION(2, 76, 0) -static inline void _g_clear_fd_ignore_error(int *fd_ptr) +static inline void _g_clear_fd_qemu_ignore_error(int *fd_ptr) { int errsv =3D errno; g_clear_fd(fd_ptr, NULL); errno =3D errsv; } -#define g_autofd __attribute__((cleanup(_g_clear_fd_ignore_error))) -#endif + +#undef g_autofd +#define g_autofd __attribute__((cleanup(_g_clear_fd_qemu_ignore_error))) =20 #pragma GCC diagnostic pop =20 --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569147; cv=none; d=zohomail.com; s=zohoarc; b=ZUdBDt91L8kQ429NxmGMD1pXsHhwDZJZR9XsQIJtbdDbGq285GMAJHXxR62Ufin3tHJ0cju3tpNqOUb8bZILVP8VTrZyx0DW/V0VZvVJTHIRB2rVrFz1nNzj3R/t6CznAh5X/dOlH39GcnrOBxX1b/Wn+jpI1hJcDKoHDE5xmdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569147; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eqYrNK+ys//UaGy7K0vgDldGdAKN4i1XSwiHAV7TkXY=; b=VwAlV8dUD4rjXBM3hq3sCWnN6tPFi8yjO6BZMTt1NPdLKuqCuTT4ptz1kuUtyvDWZ5sQc27RF2rNiN9eMORXD2pae57246YZsrfEXMNr7KOc6e77bUNoDlF4QBbo1TDtKQGp59qm6zRM1LVozg/1aNtwOOUCNhI/I6Wkq/jSEck= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1792569147894132.9803790105425; Wed, 21 Oct 2026 00:52:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR74-0004d3-Mb; Wed, 21 Oct 2026 03:51:55 -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 1xJR72-0004cg-NT for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR71-00042I-Ai for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:52 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-qGZ7N9BiMKijR9ecJxncjA-1; Wed, 21 Oct 2026 07:51:45 +0000 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 706FF195609F; Wed, 21 Oct 2026 07:51:43 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 32AA830000E3; Wed, 21 Oct 2026 07:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eqYrNK+ys//UaGy7K0vgDldGdAKN4i1XSwiHAV7TkXY=; b=hMJXj5MIReUQF5fULWwCwwD7Vll+KWBhAmKniEiLU7f8TQzgV3eHnOh2vgJT4WQmGJ5WSX NL4Pcj28ws9Gvj0oiFZf5r65BCNOKZb48TyizeYcS/VIPPdJHuEj3mxObfzmPjlTtrnKdN Hqfmt3Gvn35UJTMK7XlvtDA4504Xe48= X-MC-Unique: qGZ7N9BiMKijR9ecJxncjA-1 X-Mimecast-MFC-AGG-ID: qGZ7N9BiMKijR9ecJxncjA_1792569103 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:11 +0400 Subject: [PATCH v2 8/9] tests/exynos4210_uart_fifo-test: fix buffer leaks MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-8-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1132; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=6qk9s23emzvCS68kP8h6EMYINdQtUHNOCgnfOQ6ybQs=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7tjn2s5qmkzM1DrMmDKoe29ebkXWpxePRK2 WZuaX/dvL6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7QAKCRDa6OEJdZac 5d94D/4iCSW0qOkTSJtxJF6vUIyojUZHsc0sFoGHimYUfTqKv02Oy0VVVq8pnBTa6QR6qlpMX/O vGWRxIqkLMFFb1JEdv4+uiWVmEeJ2s4nwlC+eezZDNelVsb/zZRcSxr0uJTrxWA87GxiSEKlQn3 7go5bXN1RZthMf8o+VjSAd6piYGjSEA0ZcFQOp5AdtbGMM6/ZTvUx/OsaaG4GsmwYoSCW0LdKhJ X8EIlQIVOG+oASx8PawZ0Ym8+xxfoF8NvlCgQ+GVSyoA8oHItAXx6k3SJD6K/fxVeHK4Yn+Khup j80MNwjg9Q7PKRNNe+lCQyVCsJ13TNTELIX3JLAQobI6miJQ2CarIOOSWxFrM7AZdPeCsHHKjci kPHqpJw2oIq6a5bXU2psi4NaTPYzGvndfabOJHZ0aVQ5yGyfk9zgFS3919Afc+/Ql0hbO9IvyBS UFNXKnimLd3M25buWY7Dgqp+H9Nd/DKTwqSELm3D96BsfEwyrXNAr311afqV+yWdP61jiC3Ml2z Aeklnl0QfuB37Ld33C1lk5fSzTnNC0yqsBp/oxC41ViTiYY+FTne/4jbnw8SEQ38aARPNJCbLWB VOAQXhlU+F9yWvaAqDgOmwYevEsWRSPRRQ8XSo1gdDDT27Wz1Y/kd3rC+NYMJ7llkFp2PHDtR98 G3ed3/EZP1MRqUw== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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 @redhat.com) X-ZM-MESSAGEID: 1792569148409158500 Reported by ASAN. Fixes: 6d459c75cfc4 ("tests/qtest: add test for exynos4210 uart fifo overfl= ow bug") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Alex Benn=C3=A9e --- tests/qtest/exynos4210_uart_fifo-test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qtest/exynos4210_uart_fifo-test.c b/tests/qtest/exynos42= 10_uart_fifo-test.c index 54c09a6de723..c336ed22b028 100644 --- a/tests/qtest/exynos4210_uart_fifo-test.c +++ b/tests/qtest/exynos4210_uart_fifo-test.c @@ -52,8 +52,8 @@ static void enable_uart_fifo(QTestState *qts) */ static void test_recv_large_str(void) { - int sock_fd; - char *sendbuf, *recvbuf; + g_autofd int sock_fd =3D -1; + g_autofree char *sendbuf =3D NULL, *recvbuf =3D NULL; QTestState *qts =3D qtest_init_with_serial("-M smdkc210", &sock_fd); =20 enable_uart_fifo(qts); @@ -71,8 +71,6 @@ static void test_recv_large_str(void) g_assert_true(TEST_BUFFER_LEN - 1 =3D=3D strlen(recvbuf)); g_assert_true(strcmp(sendbuf, recvbuf) =3D=3D 0); =20 - close(sock_fd); - qtest_quit(qts); } =20 --=20 2.56.0.116.g6de20f6092dc From nobody Fri Oct 23 21:31:51 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1792569149; cv=none; d=zohomail.com; s=zohoarc; b=C48GT8SW62OnW+yWroAkugo1UYpTwWuRLwQhUsFCaBR6hEcWEm/o+EJ3CPXe1Bhfg2ZZA0EOX2ae1OgU5+o1Sl4sWVMMaR/BKR9YEkDPWhhDB8aRkbehoH1vA4WGKNfpJd1Utu219wRxe41rZ8LKHhlg9LZMEiC+O/6PDN6Ge7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792569149; h=Content-Type: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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JupTufx8wx16zRgd1FXJYPMEUO2deNAaidiNZIsC3bg=; b=BGHpzfPxdbGPCq1C5noYiZqvOezZA7ipzqKUpDn6UJail4+GRB+UQH4DKZe8WUvnxGWdQXKM0kPvDAbwXFJNGdkPNWIHMLD9mDhLqJw/H7mD+M7UPQDsVZ8U22++lkPCxozVAig3TzCkShA88P5UVzv31qQ3mfzrwCSqNzFiyWU= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17925691493728.206426407630602; Wed, 21 Oct 2026 00:52:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xJR78-0004eq-9Z; Wed, 21 Oct 2026 03:52:00 -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 1xJR75-0004dN-0t for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xJR73-00042q-GJ for qemu-devel@nongnu.org; Wed, 21 Oct 2026 03:51:54 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-400-Ehn5osW8PHKzMgMQAUDxpg-1; Wed, 21 Oct 2026 07:51:49 +0000 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 444301800344; Wed, 21 Oct 2026 07:51:47 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ACC14418; Wed, 21 Oct 2026 07:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792569112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JupTufx8wx16zRgd1FXJYPMEUO2deNAaidiNZIsC3bg=; b=KwB/P9UARHlWm81I7KTMiegDfFWiux+Z1iFTKeWzNZGVGQnx08PCniE4vyEQwtEd3OxRil u4XzUEH56OzZdrbM54WKTsHj2WBPRTUxYQBopxt4sLxkht5A68B4NOq8BZFW4HpzdJt4xB ElzARysec3oLRiGjPdR9Mxv6d28ZUE0= X-MC-Unique: Ehn5osW8PHKzMgMQAUDxpg-1 X-Mimecast-MFC-AGG-ID: Ehn5osW8PHKzMgMQAUDxpg_1792569107 From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Date: Wed, 21 Oct 2026 11:51:12 +0400 Subject: [PATCH v2 9/9] tests/xilinx-zynq-sdhci-test: fix GIOChannel leak MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261021-nohmp-next-v2-9-85471fca83db@redhat.com> References: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> In-Reply-To: <20261021-nohmp-next-v2-0-85471fca83db@redhat.com> To: qemu-devel@nongnu.org Cc: Ani Sinha , Gerd Hoffman , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Stefano Garzarella , Jared Rossi , Zhuoying Cai , Christian Borntraeger , Jason Herne , Halil Pasic , Eric Farman , Matthew Rosato , Richard Henderson , Ilya Leoshkevich , David Hildenbrand , Cornelia Huck , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng , qemu-block@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Developer-Signature: v=1; a=openpgp-sha256; l=1226; i=marcandre.lureau@redhat.com; h=from:subject:message-id; bh=xx8KsuA3vrL8IkXpXCmEI7mUiEYaap8Z6U5SZlwV1kU=; b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBq2G7t1/knq7ItIkcrybrLVXfYLgY65tuDFeDm1 j9sRMVGni6JAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCathu7QAKCRDa6OEJdZac 5ZQmD/wJGxsK5ZCY0GW2KfBSS5zSgObFAanhtm0mmHb+aF2nAtF+Dnot8NngNUYWxQcWqaSWzci j6MqyRlNYfAe2gw/1DfEkHP4mhnnKCKHjiZlwURBLRujVdiVyDo/V/zq0EwozUFv5u/xrO80zPf 4IUx0uFETDSd1PO4KpqXFyID6bv1CRT53qNUX5i6QcAT4Gb0/KoUsnpmwAQ43u69aVg7niQG40J 537BhUIDPPxetKMVdBSz5ARLNTUDPuoruXugqWQ4ceqrS3PSX53Gy6SGXs4QxEQQ4pHbjpPdzji 4LY6NfSTuFgzAiYNJH5Vgz+nFPVXW9STWxsFzYNhytYYMX4RaRX9NyW4/a3uGOb8POPICtjxQg2 kT2Yvq/NV+F0+iSpkCJZhuQTPGyKyHoSJlWxXqaUSQW6vGGk3fpY4BenzKKx4BjWlmZkz06PAZI Vd3V/YcjlxgNIGr0H1hQkv5oBFntEWA22kk6bY5orTfibRez/8UoKzpiGrjk91QqOJVodfztohB yTDKvyN9OSUbWUTpcBwSafBtmVzeBp+LeYSEl8vpmArycTvp+LYaKhuMpoAwelaJfQz/uU5YVQa pdKhwNKg3Yju/9MgsAJNWP8vW+vZztHBSBte5Z4l6GiJXMrjUCHmOup3Txm/ICkRyqQlaWkyu7x +HT2pH/MhEiUCrA== X-Developer-Key: i=marcandre.lureau@redhat.com; a=openpgp; fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.329, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @redhat.com) X-ZM-MESSAGEID: 1792569150435158500 Reported by ASAN. Fixes: 255c627c645b ("qtest: add xilinx-zynq SDHCI sdma test") Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/xilinx-zynq-sdhci-test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qtest/xilinx-zynq-sdhci-test.c b/tests/qtest/xilinx-zynq= -sdhci-test.c index 7957358cf5d4..42e1b8f46e88 100644 --- a/tests/qtest/xilinx-zynq-sdhci-test.c +++ b/tests/qtest/xilinx-zynq-sdhci-test.c @@ -58,10 +58,10 @@ static QTestState *setup_sd_card(void) =20 static void write_pattern_to_image(size_t offset, size_t len) { - gchar *buf =3D g_malloc(len); + g_autofree gchar *buf =3D g_malloc(len); + g_autoptr(GIOChannel) chan =3D NULL; GError *err =3D NULL; gsize bytes_written; - GIOChannel *chan; =20 for (size_t i =3D 0; i < len; i++) { buf[i] =3D (i * 13 + 7) & 0xff; @@ -78,8 +78,6 @@ static void write_pattern_to_image(size_t offset, size_t = len) g_assert_cmpint(bytes_written, =3D=3D, len); g_io_channel_shutdown(chan, TRUE, &err); g_assert_no_error(err); - - g_free(buf); } =20 static void wait_for_block_count(QTestState *qts, uint16_t expected) --=20 2.56.0.116.g6de20f6092dc