From patchwork Sat Dec 28 01:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Barrantes X-Patchwork-Id: 13922227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 477ECE7718F for ; Sat, 28 Dec 2024 01:22:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRLX0-0003cX-0T; Fri, 27 Dec 2024 20:22:18 -0500 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 1tRLWq-0003by-CX for qemu-devel@nongnu.org; Fri, 27 Dec 2024 20:22:10 -0500 Received: from mail-mw2nam04olkn2070.outbound.protection.outlook.com ([40.92.46.70] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRLWn-00059i-Q9 for qemu-devel@nongnu.org; Fri, 27 Dec 2024 20:22:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bdww6NdZkg72OnWD+PQORzWDf6oNOMGOMAHP48EGUWl7YzUx4Qz9OjyLIOSS1JFX1E4xMdP66TBmY4wOIVl1pr5R98yGXm639gMM9buT6+cRFTSJ1sLMJfj5Utq66u07EcHGrNZd4yVNS9mjrq9VvJetzTGVEvZHXwgZuOIaJxNyp+BGTKGD1YSDNYM7RFJbtOYoZj7cBmDQNZLzgw/quhRo6vY00HBoPt4AgZUHkITXpvK+xbRnA+WGJLx5iKYvp8cWfi6WF3TqNS7rq7ufGc45rTaw4vpeohDaOQCtYAfiMuJh8EpSdxw/mFwvBS5Lc01EIhL5GXKyktji8p3T6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/twNBLgq0twKJCEjyKjONh1T793vMySaxDSdRH2+jXA=; b=GyhlaCqaX8gTD73QAnZT7LTZkDlm6hMHt9rz26FHnktQdEI9Od6Jn/D5gx1aYamcc3svtprsftKAXNGtfQo8KfV+2E2B7pvp4ro34DeL/F8bDqF5W33aLbfRc1hK0zGvynIOASQZbbOlHzh8dGythzz81Q7ydfgB0522JEHeHDlnTtQ3Q20j3JjHjDLMqKMmAemcSMHMzWc/geJ5kfpu+Wti93Sg1eCJdSs0OOMPs4QIW1LJSSglSJWFqlxQDHjuWWZqQo0LrGeROoXWiRVyroIugbPSvF471w3PRzeJgV4c50mbXofPX06XlN6tntSdaA0WboFelq9f/8wt7Wd6ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/twNBLgq0twKJCEjyKjONh1T793vMySaxDSdRH2+jXA=; b=H15m7ykV/RPbaGK1XPuFY27iV47mczP9zlEVutyRg836cAxtAdHhXsAvcjkxwT62ZbSXEEFodBDMtyQoAhb7oKPJZn0X0pCQiKs1o07hWELeIaoRRnPew8FVPrwIS+VnaYF9TkP3zzxPfonYHvkPwxrvRHHLMJkAMgN+8JvSp8CH+NEmHw+aLqyIXqbbzyFIxDkj3ZwpAU57dZRnxprxemopA/WJirK79fiuQe6CCpe0+vACEZeVGCeJ3QK6kwWSKAm6kotKGjc5zSqZth9p8mB4wAyON4kcPso8yd4CMlpZMvLpcOZSvZImmyaQTc4MPKXwJXoko7wMXGlRf6dzFw== Received: from DM8PR13MB5078.namprd13.prod.outlook.com (2603:10b6:8:21::22) by MN2PR13MB3696.namprd13.prod.outlook.com (2603:10b6:208:1e0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.17; Sat, 28 Dec 2024 01:16:57 +0000 Received: from DM8PR13MB5078.namprd13.prod.outlook.com ([fe80::9415:f99c:7abe:e230]) by DM8PR13MB5078.namprd13.prod.outlook.com ([fe80::9415:f99c:7abe:e230%5]) with mapi id 15.20.8293.000; Sat, 28 Dec 2024 01:16:57 +0000 From: Gabriel Barrantes To: "qemu-devel@nongnu.org" CC: "arei.gonglei@huawei.com" , "pizhenwei@bytedance.com" , Gabriel Barrantes Subject: [PATCH v2] backends/cryptodev-vhost-user: Fix local_error leaks Thread-Topic: [PATCH v2] backends/cryptodev-vhost-user: Fix local_error leaks Thread-Index: AQHbWMHYj+WU9YSsh0KMxa/y8GKTlQ== Date: Sat, 28 Dec 2024 01:16:57 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM8PR13MB5078:EE_|MN2PR13MB3696:EE_ x-ms-office365-filtering-correlation-id: 90c1e67a-213e-4404-36a8-08dd26dd52c7 x-microsoft-antispam: BCL:0; ARA:14566002|5062599005|19110799003|8060799006|8062599003|461199028|15080799006|15030799003|440099028|3412199025|102099032|3430499032|10035399004|1710799026; x-microsoft-antispam-message-info: =?iso-8859-1?q?hybzcNfafX6tJMCCFILSgjQVuU?= =?iso-8859-1?q?KJoP3bItM3ZPhALEJBjsFc5keADuNowkDkJDHrOOJFmnZdsfeWdpp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mdacqdn+7YrxEACXrh069XAgt9e6stAboUCfmvq8lUjfuxBhyi4?= =?iso-8859-1?q?lIvzDxro7OAGlJvUVWK2w7qqNllkNVyKGoVz9NM0OjYDfXD9PVkzgCe0R+uT?= =?iso-8859-1?q?WYjNkoPJLSANkvXkyOloPv9r7SohNk4/bCA3po1td60pUHDWUxmFuWOd25WT?= =?iso-8859-1?q?8EumWbsp819eNi4oVo4uz3f7gSWIo+fQ8s0oWqr3/R4DOEYjGrIViC8+Y6BW?= =?iso-8859-1?q?azcGxjeTm/aE+Iy0Kk1sVxY478EIdheaFLpuqgY2sT6Ywr1oHcJzHLmQcL62?= =?iso-8859-1?q?XxvUU3FfOvxtAdEZXYbsqcpMps7VfJB2QLKSkumESq+e3ybz1c/hAt?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?DkcFmkxdgeAjnvj+W/b8NdV?= =?iso-8859-1?q?UYuMhJAsw9Z77pWhVXw3Dayri/6MsVWeO6F550EOnZJ0CTtJUf88aUbF1Apa?= =?iso-8859-1?q?21OaxMDVs2SlQE9qJDB4dqJxkBSJ9/zFcvPIISOBDgz+4YtSWCHMdyi2IMaF?= =?iso-8859-1?q?iE13nnOeGfadolPJcM57S3TM4QCu1B5121C/S61e/S1LaL91yADFKcCpux+A?= =?iso-8859-1?q?TSl/Y2nOxX16AuIFe9WerxVQ+bBtDbXdlzuWQ5sJZviY83m1FfFqFxG1I2f8?= =?iso-8859-1?q?vFQpRXVZdne2mvdvDUsneEBb08xwRxf4RWKMhVdpP1sxwfAJybentBsOANGF?= =?iso-8859-1?q?6XnJ7K1GaQzW9GApEQN2X4zcl85qNFQbEpzs94hgGM1nkf7ARbcmgGzYI/fQ?= =?iso-8859-1?q?hqC+XNiqs5Y+l5KLyJ99vaD+p2B3JU0L1LF28/mo2sz6Q7cRi4n72rjqTQHf?= =?iso-8859-1?q?7zybwjwjC2wkpesNpsyzklTHAEN88P2FakMuHlYWa0B3aNDPgRfKNdQIZXpF?= =?iso-8859-1?q?mVyUbmecVVec8GeeHDlK1157kenIgVEbcTnS4ar4MdmodYe9/ha0w2rcf5Ef?= =?iso-8859-1?q?ZZYi1B51JGyomvEDfaZUYwli65IyQtQbe1syDiRWRby6VTXWEXhU4JMS3R8m?= =?iso-8859-1?q?X7Iub6Nco6+COBlJBVzNNIlV+CuV8wVp+2hwBfETYKZOBVtbVxYlwS7sxt0G?= =?iso-8859-1?q?Kn4crNwtN8LmXCFS6S0yCrP9qgu6Lkfuas7OANzLIF78kPD9OCVJH6FY0W4g?= =?iso-8859-1?q?eOaBuwL8KbgxWEOI0E/bNNQsVtvsxELCatmNlNKLs92KDt6fyCUvUsIWSkwD?= =?iso-8859-1?q?iutU3zgcHTaC7RRHMlsz2QAF671YHPX0wWOMx7SBuKw7dPweWru2pCoo+G2T?= =?iso-8859-1?q?CbfTeLBZbengEFmGZsLNq5nrxRDN2nIMd26d4AtJZyV9KUYLr2eD/dejze4/?= =?iso-8859-1?q?KqNYByhP/oM0vB5o7hQcRn+X6sdVioF3+P7IW6rRoa/jhDkKeLld1Lzl+yo3?= =?iso-8859-1?q?qQC6zEv8bo7Z9ha3IRShB3t0rrkJKHuJ10Wxg7zrmd+Y7uCiCJLeZto8Qrs7?= =?iso-8859-1?q?7U1ICOne4ZV+SdCvGheY+jjv67QNjUQwkAKVke1wJU+1Ir4+e4An+eM02D98?= =?iso-8859-1?q?Wq/0UXvGi8ShS7hlQg1tsbPxqD8Xc5TSDb7A9ZN6JYRN0r2D0fm5Zb82mO5j?= =?iso-8859-1?q?SkBCL8lbPf/kPwe0eteuvl5X+LGtorlVesd68TbMQYeW1aOLKGWjxow87y9p?= =?iso-8859-1?q?YOnAjE9oJU9BKTybwKN+eYLOwfuaY3Q1x676MOnhZrMiM4oFqPNMRWg/R?= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR13MB5078.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 90c1e67a-213e-4404-36a8-08dd26dd52c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Dec 2024 01:16:57.4794 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3696 Received-SPF: pass client-ip=40.92.46.70; envelope-from=gabriel.barrantes.dev@outlook.com; helo=NAM04-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From 532af9eecee4695abb02b40f2c18b711370aa7d2 Mon Sep 17 00:00:00 2001 From: Gabriel Barrantes Date: Fri, 27 Dec 2024 18:02:32 -0600 Subject: [PATCH v2] backends/cryptodev-vhost-user: Fix local_error leaks Do not propagate error to the upper, directly output the error to avoid leaks. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2714 Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode") Signed-off-by: Gabriel Barrantes --- Changes in v2: * Add full link to issue. * Add reference to first bad commit. --- backends/cryptodev-vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.34.1 diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user. c index 43efdf9747..f87172b330 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -281,8 +281,8 @@ static int cryptodev_vhost_user_create_session( break; default: - error_setg(&local_error, "Unsupported opcode :%" PRIu32 "", - sess_info->op_code); + error_report("Unsupported opcode :%" PRIu32 "", + sess_info->op_code); return -VIRTIO_CRYPTO_NOTSUPP; }