From patchwork Mon Dec 23 23:46:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriel Barrantes X-Patchwork-Id: 13919581 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 F40B1E7718B for ; Tue, 24 Dec 2024 01:41:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPtug-0006ye-HI; Mon, 23 Dec 2024 20:40:46 -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 1tPsDX-0005Fv-84 for qemu-devel@nongnu.org; Mon, 23 Dec 2024 18:52:07 -0500 Received: from mail-dm6nam10olkn2077.outbound.protection.outlook.com ([40.92.41.77] helo=NAM10-DM6-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 1tPsDV-0000kI-Js for qemu-devel@nongnu.org; Mon, 23 Dec 2024 18:52:06 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qTN9BefyOejeMughG8uNKEzGPVp7TfQC/JFTBmGyDTbvT2GBR4KVxgZvN2wUvqu9mw72KZuzGManmt/Sb3iuuHnkVAgd2JTF7cxbX9yfyul0/UlFffXSxsXlAYhdEnLrznS3qKfl+sagp0QSGPrhqHF2Y24gjGsgYURbt0kFupMRr74IPHYd1D/pq+1WDRkpFkS7O2feapghzjOd/hkaFKodlsuILuhlYkUmKeEeuFNUWLjdMaN0Jw4fRQCO7Z9qhEfeIObZE78aI14jEGRYLxMmxJJ2OF74cwIV9RAGiK3Dt7fHz8/8Q1Bc3KSkYmYnAAfv+PEJPwUgLItF2DSO9g== 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=jtqeXWNq7zTpQp4B8ESToRKv/if1o51X0tuM51tz++I=; b=SW6VCgAFcBEXnvsVU4iW/hJD7AmKKV1Zw7eUc/NIFuFhhYrSkPY3KFMnxZbYUKsTa/FkpI/GudAu+fn/JpZl+yV4bDiRdfqzZ7P3Tj2Y+1aCfDi5iQKY82f5+fQPEAkMWHUc3anhx99ZS9ys09YynI0kBBFpzFiEkr2vqU5tRWY+zJHkASHIpNNotoRDQwpGcgLcnmyfJ+gwy6cYOa//cUKW/e16iazE25g7HQjZQ68NfTGqhmZ1FuUsPtZYWnUdHlLwoxP/uynuDktVtzsRi9JfZ3VUIJWIPodbl7rZLDJcP9N/1UdrS9c1CaQEy6gj7qC+mQOabCcD99KPVqG6xg== 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=jtqeXWNq7zTpQp4B8ESToRKv/if1o51X0tuM51tz++I=; b=mwD7REkShh89ZPRXylph5v6dJyC0mREjv/m4EtFc4H45PDYwjLrhy3HHzLEV6kElzm/JhIz2D0jH+Lk1EvUQXRbz1wYnzQ7B9B5CJbYbcQlTSiWKFDbRYntHncKEiFwUcD2qBOQFjY2dHXH0RYKC9juGuxH3dZiVH4+oObkkvgHb98J4bATIWub2VAN0IdCyhlwAuaWk15Y3WOopAKtjy4XHIOLe5A7XO6fUdEyR0VL+BVmL1CnJrUjQSh3J0YwqjPpb2uTnkzJKmxn7cAPltBmG1yiRNBwKD4kcpS54teHjEkzlgwicQxJ3I7vJ/XnZJjD1ENQBr0lTEcW1MKFh4A== Received: from DM8PR13MB5078.namprd13.prod.outlook.com (2603:10b6:8:21::22) by DM4PR13MB5834.namprd13.prod.outlook.com (2603:10b6:8:41::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.16; Mon, 23 Dec 2024 23:46:59 +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.8272.013; Mon, 23 Dec 2024 23:46:59 +0000 From: Gabriel Barrantes To: "qemu-devel@nongnu.org" CC: "arei.gonglei@huawei.com" , "pizhenwei@bytedance.com" , Gabriel Barrantes Subject: [PATCH] backends/cryptodev-vhost-user: Fix local_error leaks Thread-Topic: [PATCH] backends/cryptodev-vhost-user: Fix local_error leaks Thread-Index: AQHbVZStpmoWkKHHv0+a+lCeigXtJA== Date: Mon, 23 Dec 2024 23:46: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_|DM4PR13MB5834:EE_ x-ms-office365-filtering-correlation-id: 42f52202-04e2-42e7-d80f-08dd23ac16b4 x-microsoft-antispam: BCL:0; ARA:14566002|8062599003|8060799006|5062599005|15030799003|461199028|19110799003|15080799006|3430499032|102099032|440099028|3412199025|1710799026; x-microsoft-antispam-message-info: =?iso-8859-1?q?q6OvQQ2YAbaIVJVQw1yXXENW0g?= =?iso-8859-1?q?O8O98nxbGTPLKDgmPXohzuiiAEa1hocYn1HhD2NcUHeL6mwyRNiQooVs/qFJ?= =?iso-8859-1?q?zN9TQarCwnY4S2w/0VYMjwqaO28vPNmNZO9aTWiwfdkMSjoDZUdxdn4mOW0N?= =?iso-8859-1?q?+yIn/Z6ZAYMM3C1SDYGYPl9RoY9BIUgEPdfEKQ8+qngMnEdi9fCOqqJQ56Lq?= =?iso-8859-1?q?lBXTrZs4mKJZljVtUp3dAK5L29CMO05Eo92hHsAwMB8HXfOObgE8wMlgDFke?= =?iso-8859-1?q?6G1u0Q8aBj0TfCdH/cXFCqJLq87iGISJ9L2VSd0ObouuRzkSjMJRuVtyLIXn?= =?iso-8859-1?q?NCms1VSSi02rJO+/6s5aILtPnufw30l9PYEIZGpelFotYppVSjNa2kLZso/s?= =?iso-8859-1?q?PqusTVKwmdoVBej8GR+gt8MWByTV92NZvxiCsVVm7DmAViBPhD1jLq+jf2PB?= =?iso-8859-1?q?0K1OZYpbK99/cmvNZPX21tvBx2g848k2kQn1SCHVXLJXWxq4XLEWGFHbHlZt?= =?iso-8859-1?q?mjrNuBsDTzCIlXzGp6vVHEas8SpzLQQD8kaRf0SQn066dM5TYx/NmfulT0BL?= =?iso-8859-1?q?CuPgGKegmR50XIm5QCRYIYIVlkotbmw4kLaRclGXxy0eLciOaTuWBfGqiAGe?= =?iso-8859-1?q?T0XNCRj+NUaHwZQwuyk3Bzv84s6M4P7aSS22ONbd2ttJasgcV+8xjtMHlk0+?= =?iso-8859-1?q?sAdS8TmwaDtpf+2pUPocPjnEuL4rWLeSCfVw/x/oP06RItSZTebYDmihmIy5?= =?iso-8859-1?q?LzY9ny7lLKD6RgTgK6kk3zzyfvFO9ITyV0p0ce4NzTm4HpyrqkSj/E0fUT70?= =?iso-8859-1?q?GbO5iqOtnVgPsoksFS0BaIyXFXYqfOxn+iLSTrXYaJTSfaq9OumTOHAbNy2/?= =?iso-8859-1?q?XolpMooCtkDbu8AMP2Wfz54gQv2pLNOuLUsA1AbzI8rFquzjSjsapp20Yuha?= =?iso-8859-1?q?6cSNIuz2AdDoqOBIrr3hJdbFvW13sPlrRmaF21Cf8+yUPXC2gFN5rDMQ+TEC?= =?iso-8859-1?q?koT3Ys+44kwITW89Fk1UBBbCU2zQXHCg1QmtisTBcXW+5JSqV+Avz8HLiEg3?= =?iso-8859-1?q?fQSVKRmj9Hj71Ng6yTPmGkZlbXf6/+2XpsAh0OFgs0zriPrazico4sIMcq0j?= =?iso-8859-1?q?A8wxgQ9zTobaCdqpAsMMckDlYx/PYSbI1OwsYQLdSU0erEMCTNs6SSZg8ExL?= =?iso-8859-1?q?oO5Hxu8g=3D=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?BrPrM+iz3wrkZU5UoZzRNGU?= =?iso-8859-1?q?nwS2Qlr51lWnP3uJ3ZKozhOgRzado4XHmg17ZmEbts4rJCzaM/ZwO9S8G537?= =?iso-8859-1?q?cCW5K/lbVLe32gl4iWZPC+ssCfLKhVCOtL/WAqWQsFB8VAgCAGE3A4g20i59?= =?iso-8859-1?q?gQmmU7iLI6tszQwup0j4RNtgLPPm7va1KKlk//YkBneypL4lb36X0+L03OoJ?= =?iso-8859-1?q?nBM1IuRaR2eXHiS2YvV+nDKhLX6UVSBDvMYQIMjS3qaWLlsPDi/WMHA2o+Ty?= =?iso-8859-1?q?Un+NpbR17UCtxf52DrtAE54ewSwqHhzhJlcOiQY05M4yFDc1nQ31CqvTj1Nc?= =?iso-8859-1?q?s0cdzt1w42sgoB3tdGe+EV6TrNpm6fkgp18pYZiqpP8oPOc+z0KoRsYBk8YC?= =?iso-8859-1?q?JmNmp/BDm5ifbayqsYOIhUQcC1EISdT/q655tOPiTP33cIZcl9+B9gPXZhEC?= =?iso-8859-1?q?lkD5JYXWdrPIDf0YR/XmetnZ65W2AoMU5lCFG8fpKXivRwjqIl2bdNfkrsqT?= =?iso-8859-1?q?dolbf/Z+ehfTj6Jn7VTUpQ8B996tr4jKR6p8X4WpX9BYt3BPlq34CeiYQYh3?= =?iso-8859-1?q?RFNZlHwIPgG+JG6pEZIVOt4o62rKxyXe3PBrHhKIb/BW5JTxJVmXQB9jJ6ji?= =?iso-8859-1?q?yzAA5MVojNNm627s9ydd+TpED8oi9+dojNcri0G7E50EIpbI9Lu2VHfecdmD?= =?iso-8859-1?q?5pwOYK92ArWt/4t+gFmUuYyQXn1jBBUYzyndZHKABAkoHHNgyYm2EwQs6njz?= =?iso-8859-1?q?y8FXJ2ZSK9tP+t3iE5x5QvmE7sVJM8IXkCWxEUgCfVfoM6rEiaB2f1cypc9J?= =?iso-8859-1?q?X8dXI5+MHZEVWbeHwqpZHvRRbliS2BJOX5RGrjtwgUZrvDCqdCYIe7/CiMBx?= =?iso-8859-1?q?8M0dTB63yQ8XrejgdF5CP7atI6BPPr5SelAMds2u1kaVsWINfhYp9j7x3Ya4?= =?iso-8859-1?q?rKWCw8H4xdt8wI1/gizxh/rzDYkFqaUrk9R191MxZTYsXf6CAtNcIkGgcj4R?= =?iso-8859-1?q?mTlZV8iAAJBSwZS6sjAQqSP1+mYZ6FysQs23Eo2cNdbpxTJqEtBomrzRdW9C?= =?iso-8859-1?q?JUdq3s0tA9Vk6nqKXqffWpAT1v8GTCY9baLsw6NMWUj2lP9tcJi0cQpVGzOF?= =?iso-8859-1?q?gyJuAoBSZBE6kS17xZtlmXgiqNq+K11fA+eAPYQdAI+dkuKVwP3ozSthjS8y?= =?iso-8859-1?q?1QzveCcTaoVsRvD4i6hQA2fMwVqO+6bvyuh+32+Azq6RxepEmAVP9F6QSLaZ?= =?iso-8859-1?q?cCvVtmvXG5rrdy+zxMuy3VnpIwHYPlUvBJUjqTWZ4J257EPSo39d/0BNS?= 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: 42f52202-04e2-42e7-d80f-08dd23ac16b4 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Dec 2024 23:46:57.8236 (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: DM4PR13MB5834 Received-SPF: pass client-ip=40.92.41.77; envelope-from=gabriel.barrantes.dev@outlook.com; helo=NAM10-DM6-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 23 Dec 2024 20:40:44 -0500 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 c808fa797942b9bd32221594b7eef690a7558b14 Mon Sep 17 00:00:00 2001 From: Gabriel Barrantes Date: Mon, 23 Dec 2024 14:58:12 -0600 Subject: [PATCH] backends/cryptodev-vhost-user: Fix local_error leaks Do not propagate error to the upper, directly output the error to avoid leaks. Closes: #2714 Signed-off-by: Gabriel Barrantes Reviewed-by: Philippe Mathieu-Daudé --- backends/cryptodev-vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.43.0 diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c index 43efdf9747..09bfbddb47 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; }