From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D1FE460D6; Tue, 21 Jan 2025 18:09:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A195540665; Tue, 21 Jan 2025 18:08:36 +0100 (CET) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id 05DEA402D8 for ; Tue, 21 Jan 2025 18:08:30 +0100 (CET) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02lp2110.outbound.protection.outlook.com [104.47.11.110]) by mx-outbound40-251.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jan 2025 17:08:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jyuz26uyBOTisE5qpFbcdPDQeihb51kNWv3GB5TZXq8BBsUtbR31nFdwjV472cwOl9//Hl0fbHe+OqG3dmajbdqIFjQpTCRxP44dtAXbw4N1Hjo41+L2Uz7K2pCNC6WAHwe5BKuK4GHZilwxFxsIi9L+kiD48chAymz3F2kE6via2hUCH+Yl2RycU+QnEEkue1ze6mvsxFzfA0maQy0aoKgN3IG6g5ocb8cTv4gfSkP/sAojaoTNIZQemNmhmUA90NtawT5OaHFNBc5pGQ3Gu7JSFU1ltMHYUvTAZc/OqTkgHLyI9pnxKyUrqWCamVj1xuDfdsN999zvjyT2BB7Ckw== 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=zRKpFF+WF5+nMnuUeYLUsJI0Oo30HZfnbypT5I74Lr8=; b=q0l/m5Qe6+SDqJylJEFyLnVwinhF4b01Z86uRiboIzJP7NbsSGJQY7S4z3QRUqa6UhoJna2vsQ91f99CyDRVYTyLNp/ae/bZXxLX0nt2qaZjWV9g2vDk9q9QQW13PPvAGcFJXGcWbL/V2xjjrkWJfUECtYHhwLr1lPbh/4rRhxJen8YAq/YHegF8++yfxqwbbUpfikVFK7cRrX8a/OQVq9l46u2TWz9x4lo4rhEkvwWw365IPk27mheAAxI3hZk1+UHgRIG2ALuRBblszT9xvmbxXcMK6AgrFJ6Lur3H4tbZogiGZmKO0l5h0RBoSF56LCkhUEkqyjCKlvU0l+nZiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zRKpFF+WF5+nMnuUeYLUsJI0Oo30HZfnbypT5I74Lr8=; b=jvuQvj2f6nYDq5wnGt1oR2LYlSMT38tQC58M3tvysgSznFwHtXR9YlaYJtgkhsT7ErXDMpU9mU48duKUy0qxY1FKfKtdNA/xfxNyP1x2VgPG2utFpW6a+9zLcHqSa8XdtqTPaq6Fl54Es6WqCCnVkWxUaOdPywWnbO1z0pW01PI= Received: from AS4P251CA0017.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::6) by PA4P190MB1310.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:bc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Tue, 21 Jan 2025 17:08:27 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::1a) by AS4P251CA0017.outlook.office365.com (2603:10a6:20b:5d3::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Tue, 21 Jan 2025 17:08:27 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by AM2PEPF0001C70A.mail.protection.outlook.com (10.167.16.198) with Microsoft SMTP Server id 15.20.8377.8 via Frontend Transport; Tue, 21 Jan 2025 17:08:27 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, stephen@networkplumber.org, Danylo Vodopianov , Oleksandr Kolomeiets Subject: [PATCH v1 07/31] net/ntnic: add var definition transparently Date: Tue, 21 Jan 2025 18:07:45 +0100 Message-ID: <20250121170814.3252171-8-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20250121170814.3252171-1-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C70A:EE_|PA4P190MB1310:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1cc3e4a2-5f9e-4972-687e-08dd3a3e38fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ySiA1NsFii9yh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i/Ayr?= =?us-ascii?Q?q+tUwU+QBmx+yBoF8lX/LNxdYPmWvDnCZDbRk7aTTfSnUc6+8p7PSQF/Ib35?= =?us-ascii?Q?pqzw0yVw2P4HoKYJsV/FRK9N4NMMwl2unStfUd8kLaLMSlDvHrRNOH1doD97?= =?us-ascii?Q?TJstGCbsfM7Z1GtGei6b3G4vFcbBhhUPJVCudT63Usvz9lVD4IEUV3qZRpyx?= =?us-ascii?Q?DdjvFHZqdj4g3JQLTejbEOn0u/nccrsPvshzBEN2g93iFuR1XV8izDTx0+uD?= =?us-ascii?Q?oatPN3HIIft5LFFysl12UWvRhs6WvwL3YjbQqW8a8ebLPxLsBSqK9t7HUn8L?= =?us-ascii?Q?5tHNf2wgW2YgGG5ejbf99gGoeWJlxt15KAGoha7nqjk1P/Pm5rT+IuJML6BF?= =?us-ascii?Q?fxEmRWKwq8FiIaIaDwhocwb5/xCDtdj1+htLXfM2DVQZq1qVMNz3zgdmYYpJ?= =?us-ascii?Q?u5D0sKqgGlMcP+/e8f/9Es+8SfZ3rZm9Sv+TuIDdZplZCarHflSt8YHwEvlj?= =?us-ascii?Q?PYMkJ7hdL0dkJa7bYgBGo/jvFLkwZG+2ahdmdrGnOTZXgrWhd53s0s4xc+zY?= =?us-ascii?Q?3wmKVIu0z1XGXIf5iSAJx3VA5+FVC8V+Is2FDjxKirr9lR9ShAsLjg=3D=3D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SLtua7dZxW9CK0zFo7P/3qx+wUyOidn51gUAB+MLUIZ3IyBfcar74z9K+QRJYyaZGb+PR+CEWQCoECka08JxZ9TCOh5tEYiC9yFm23PI1iLNZUlgr1ys2tCzLPseE0a/FEz5By21MxWCk2GJbOlpfXTvd0sDHqxqcNGSYHhc8BQky+IHnNi8sk0PKxlK9eUdfPrAMsUIo5zxbt1lpR5fRa+QFXERvDyflY/jS5R1ISyomvalNz/xmR4yBTVHb5gHUNymzQhGEkBKZa8QYPibh0tkkocErD48rkNeyMatcondsTWbAXDzyiaDzrW1awCyEugk8q4NE/Tqjug/lFWsALB+LC9FSkz3Rii6/chulhKJhEk+pHcfY0y9hZm+6M4Y5tKhafLbAPp62yxzLfsffciaZ4ATd+cFAROfVlXENkWxhKrYbLsvAs6J2RNEv3LXjjo7ikn76IZ8Eb2uRWR5yGWHRGiM5Uwocv5ITPTo9UrdNHEHY+4mK9WG1cjVLTDlrQa62vUE0ly2Oc1/i58WAJ5HEY1rI+lZZNci1HqCKHEQnrJXutICyWUABQzya8QZSvNp5R+/Ju+YopPjAIJx5lYmnJ5xGTfvl7zyS/ScTx0NAoiO9+HOMfvvEqJc0ZjLWxTVDhZmUqQEI5Tkwd/XCQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:27.3587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cc3e4a2-5f9e-4972-687e-08dd3a3e38fd X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4P190MB1310 X-BESS-ID: 1737479309-310491-13357-7742-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.11.110 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVpbm5kBGBlDMIiXVJNXcwCglNd XELMXAMik12TLZ0sAwycQ4OdnCyFipNhYAHob84kAAAAA= X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan10-237.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Danylo Vodopianov set eth_base to NULL after freeing to prevent use-after-free CID: 446746 Use after free (USE_AFTER_FREE) Coverity issue: 446746 Fixes: 1d3f62a0c4f1 ("net/ntnic: add base init and deinit of flow API") Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/nthw/flow_api/flow_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index 82d4e34ae9..d25d1a3dd1 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -385,8 +385,10 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev) } /* Delete all eth-port devices created on this NIC device */ - while (ndev->eth_base) + while (ndev->eth_base) { flow_delete_eth_dev(ndev->eth_base); + ndev->eth_base = NULL; + } /* Error check */ while (ndev->flow_base) { -- 2.45.0