From nobody Mon May 20 04:09:29 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683022789; cv=none; d=zohomail.com; s=zohoarc; b=lEqeHYzTJRar2Ss4p2VQ+4O9bNXI4WuGwGKiaR3bpw+of0FlJXbnzTLdVlGyNWQhd9DKbqISQ+WxvJaV3PGniygsPn+S/ZGP9F5Ehjj3yis4IJLdqKbm6iH8Q8yzm+cCYdUOrRSDyVdHkF/ArsPEma4n9k4lPpN5lGaxiZ+OQZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683022789; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sdFgf1NbKu+A5/DM+x4xrm7n6SSwRdU07Tpi++x2oqE=; b=B+zySm9HdrkwpmAgCyCDvAecdvCexIRdMl+lkXeF+TAAe+mZyivm/Jn0WWy/1EpF7aVFdBSw+9kf/np8PapWbsef3Rl6xxsoNJH0MGtFdPEbNXLjjTFyPBdYogqOCl+Ca3Sa/NvYm5PXYx0zEDTaUa1emSDR8kI2YSgdW65ae4U= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683022789788915.0772641212945; Tue, 2 May 2023 03:19:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptn67-0004ml-05; Tue, 02 May 2023 06:19:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptn64-0004l8-S5 for qemu-devel@nongnu.org; Tue, 02 May 2023 06:19:00 -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 1ptn5z-0000Kf-5b for qemu-devel@nongnu.org; Tue, 02 May 2023 06:19:00 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-39-hwbUWV2hNcihH5ycteHLww-1; Tue, 02 May 2023 06:18:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EBFDF87B2A2; Tue, 2 May 2023 10:18:52 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DDE7C15BAD; Tue, 2 May 2023 10:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683022734; 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=sdFgf1NbKu+A5/DM+x4xrm7n6SSwRdU07Tpi++x2oqE=; b=WXlTZ0hvtsRmBSE0unSAHC+0Rltjd+gqcJsV8B0LtUsquNygoSLCvHJseRTFP4KcUZNip1 AG/PspbM8XIWYhYZ57nBUz7M0fGIAp5kSNr98xmvh0mAgiJzWajGdWyUb8iPhUOyw6pUJD fRTHtJeQPeP7q/3hzcj7NRhefFCTv4M= X-MC-Unique: hwbUWV2hNcihH5ycteHLww-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Alexander Bulekov Subject: [PULL 1/3] tests/qtest: Disable the spice test of readconfig-test on FreeBSD Date: Tue, 2 May 2023 12:18:47 +0200 Message-Id: <20230502101849.1655453-2-thuth@redhat.com> In-Reply-To: <20230502101849.1655453-1-thuth@redhat.com> References: <20230502101849.1655453-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 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: 1683022791766100003 The spice test is currently hanging on FreeBSD. It likely was never working before, since in the past, our configure script was failing to detect this feature due to a bug in the spice package there (it just got enabled recently by the commit https://cgit.freebsd.org/ports/commit/?id=3Dcf16b1c9063351325f0 ). To get the CI working again, let's disable the failing test for now until someone has enough spare time to debug and fix the real underlying problem. Message-Id: <20230428151351.1365822-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- tests/qtest/readconfig-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qtest/readconfig-test.c b/tests/qtest/readconfig-test.c index 2160603880..918d45684b 100644 --- a/tests/qtest/readconfig-test.c +++ b/tests/qtest/readconfig-test.c @@ -86,8 +86,8 @@ static void test_x86_memdev(void) qtest_quit(qts); } =20 - -#ifdef CONFIG_SPICE +/* FIXME: The test is currently broken on FreeBSD */ +#if defined(CONFIG_SPICE) && !defined(__FreeBSD__) static void test_spice_resp(QObject *res) { Visitor *v; @@ -209,7 +209,7 @@ int main(int argc, char *argv[]) qtest_add_func("readconfig/x86/memdev", test_x86_memdev); qtest_add_func("readconfig/x86/ich9-ehci-uhci", test_docs_config_i= ch9); } -#ifdef CONFIG_SPICE +#if defined(CONFIG_SPICE) && !defined(__FreeBSD__) qtest_add_func("readconfig/spice", test_spice); #endif =20 --=20 2.31.1 From nobody Mon May 20 04:09:29 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683022775; cv=none; d=zohomail.com; s=zohoarc; b=giu/UgdErCPIIRglQqfN6qTxCXHF8zOjE4UGQEeb7LAf+kRdoPJyLAtGmIoDxbo8+zq6GkLGxWhU0xSPayTQB2o6DAOoKmk9WmF2gBhsHbRghGbq+jQjmHvmk4chX9qO+g8HAGEyvL6b+ycEhn2uX16R9wBaAKCiwKymlL3mXSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683022775; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OjJep3vnYJbCs0zCTqdSSI7B0QJiSrseSafMexm8/Ek=; b=GNqSE/OIbMHqV9NQMx1H/4U3oOGOk/WsShhtAyWlZrzQ1B1hasF+3KENhEvp/HcGIj76awHw9QfJaaVvCI2n+4H97Y3WqVfwNjXv/RQ3kYsa6acv1RGK8G+9+UZheSJIxc4dcSpshj1SaYDZMmmZpmRVB7M0Kj+jXQ2uIFU2AB8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683022775475649.5951406067696; Tue, 2 May 2023 03:19:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptn65-0004lL-2C; Tue, 02 May 2023 06:19:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptn63-0004kW-P9 for qemu-devel@nongnu.org; Tue, 02 May 2023 06:18:59 -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 1ptn62-0000L1-99 for qemu-devel@nongnu.org; Tue, 02 May 2023 06:18:59 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-608-5GJHwxVEP2yZuvBh83HzJg-1; Tue, 02 May 2023 06:18:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E61ED3C0D182; Tue, 2 May 2023 10:18:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37AF5C15BAD; Tue, 2 May 2023 10:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683022737; h=from:from:reply-to:subject:subject: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=OjJep3vnYJbCs0zCTqdSSI7B0QJiSrseSafMexm8/Ek=; b=gYWHov0rDS8Kesgk1LI6QyjftCWKAqITW+/m/M1f49BjD0Nm1QqgAMS0Q7UY0eRwwgG0Wd Up2/BxkmQIAMZgRWyyPXHjsFFeT78D2veGawerOYYf68I68OnRX8wUbM0V4qc0ZcUTU+g2 hvaQaExSLS2oRwW7xhjEUarEeSRxknE= X-MC-Unique: 5GJHwxVEP2yZuvBh83HzJg-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Alexander Bulekov Subject: [PULL 2/3] tests/qtest: Restrict tpm-tis-i2c-test to CONFIG_TCG Date: Tue, 2 May 2023 12:18:48 +0200 Message-Id: <20230502101849.1655453-3-thuth@redhat.com> In-Reply-To: <20230502101849.1655453-1-thuth@redhat.com> References: <20230502101849.1655453-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 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: 1683022775952100001 Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas The test set -accel tcg, so restrict it to when TCG is present. Signed-off-by: Fabiano Rosas Message-Id: <20230426180013.14814-13-farosas@suse.de> Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index cfc66ade6f..48cd35b5b2 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -213,7 +213,8 @@ qtests_aarch64 =3D \ ['tpm-tis-device-test', 'tpm-tis-device-swtpm-test'] : []) + = \ (config_all_devices.has_key('CONFIG_XLNX_ZYNQMP_ARM') ? ['xlnx-can-test'= , 'fuzz-xlnx-dp-test'] : []) + \ (config_all_devices.has_key('CONFIG_RASPI') ? ['bcm2835-dma-test'] : [])= + \ - (config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test']= : []) + \ + (config_all.has_key('CONFIG_TCG') and = \ + config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test']= : []) + \ ['arm-cpu-features', 'numa-test', 'boot-serial-test', --=20 2.31.1 From nobody Mon May 20 04:09:29 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683022792; cv=none; d=zohomail.com; s=zohoarc; b=Uf0OA+kQy3uP38B3Pf/zqgICqlpMWdQMzOrMmt3quYLXxo+rkZ7tXe0TaENePX43DKrhMdmuFE5F1ePzrN/6cfjsudt3jEl78+87Ovj64VNW5fIL4gOqPAZlWvck0CGPmkPXaOg4ZkT8VLwBTtN8Ec1Ld3zDPkTX5UH31H/GOmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683022792; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=31b0d8QLBF0vY+1zakSA7/awSDWXgOMapmyXoEDqdwA=; b=bapj7qVmHge65of0jhBZFm3xcqgdbTBfkmYVRJtkm4wA4hfuVO2P232H8OvFEGJZk6izCW3w/1JtjGU2aSI7Vld5qPv/R+ZU+sl/PK+KpgrtO16a7hPMXmIMyx/z3SIxTZ0UfT+R0UVQwzGmsb0UP/yortW718wPA2/HQqcf1/s= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683022792860161.47427521312602; Tue, 2 May 2023 03:19:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptn67-0004n3-9y; Tue, 02 May 2023 06:19:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ptn65-0004lV-7O for qemu-devel@nongnu.org; Tue, 02 May 2023 06:19:01 -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 1ptn63-0000L5-6U for qemu-devel@nongnu.org; Tue, 02 May 2023 06:19:00 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-AAR9oWqgPRSsxM-yow34OQ-1; Tue, 02 May 2023 06:18:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E06A029AB3EA; Tue, 2 May 2023 10:18:54 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33251C15BAD; Tue, 2 May 2023 10:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683022738; h=from:from:reply-to:subject:subject: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=31b0d8QLBF0vY+1zakSA7/awSDWXgOMapmyXoEDqdwA=; b=iwQ6K+eI550IDUxflkBSBkaV8ZBk7dbFwBVJiUeTRZYzqmIilfE4ZnKz/9rgFGy5A0ajlt ls63TBXhwbnv3ZUb1ItcOOooWFjLpZrZLjahxcThTKvlb0MRKPQn+wUEjai7GkYSCUCkUx tiV3f0oPt6mZlUgdU22T6JWHDTp1B5A= X-MC-Unique: AAR9oWqgPRSsxM-yow34OQ-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Alexander Bulekov Subject: [PULL 3/3] async: avoid use-after-free on re-entrancy guard Date: Tue, 2 May 2023 12:18:49 +0200 Message-Id: <20230502101849.1655453-4-thuth@redhat.com> In-Reply-To: <20230502101849.1655453-1-thuth@redhat.com> References: <20230502101849.1655453-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 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: 1683022793754100005 Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov A BH callback can free the BH, causing a use-after-free in aio_bh_call. Fix that by keeping a local copy of the re-entrancy guard pointer. Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3D58513 Fixes: 9c86c97f12 ("async: Add an optional reentrancy guard to the BH API") Signed-off-by: Alexander Bulekov Message-Id: <20230501141956.3444868-1-alxndr@bu.edu> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- util/async.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/util/async.c b/util/async.c index 9df7674b4e..055070ffbd 100644 --- a/util/async.c +++ b/util/async.c @@ -156,18 +156,20 @@ void aio_bh_call(QEMUBH *bh) { bool last_engaged_in_io =3D false; =20 - if (bh->reentrancy_guard) { - last_engaged_in_io =3D bh->reentrancy_guard->engaged_in_io; - if (bh->reentrancy_guard->engaged_in_io) { + /* Make a copy of the guard-pointer as cb may free the bh */ + MemReentrancyGuard *reentrancy_guard =3D bh->reentrancy_guard; + if (reentrancy_guard) { + last_engaged_in_io =3D reentrancy_guard->engaged_in_io; + if (reentrancy_guard->engaged_in_io) { trace_reentrant_aio(bh->ctx, bh->name); } - bh->reentrancy_guard->engaged_in_io =3D true; + reentrancy_guard->engaged_in_io =3D true; } =20 bh->cb(bh->opaque); =20 - if (bh->reentrancy_guard) { - bh->reentrancy_guard->engaged_in_io =3D last_engaged_in_io; + if (reentrancy_guard) { + reentrancy_guard->engaged_in_io =3D last_engaged_in_io; } } =20 --=20 2.31.1