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 7A32B45E41 for ; Sat, 7 Dec 2024 09:10:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 695E540281; Sat, 7 Dec 2024 09:10:32 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2087.outbound.protection.outlook.com [40.107.100.87]) by mails.dpdk.org (Postfix) with ESMTP id E22BC40281 for ; Sat, 7 Dec 2024 09:10:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d2f/xz0MUr500o7ocDS81WY7oKieDwFM+JFBtrFcauHbPa/mkKUzqS4bLdR5nbVrvHV+/S2AT4MA2C+D68IvSDHimPa9szFUixyUr4B1cdI9UDyIqSHKOWVAXcYDtwZdAO8NE9cB0pyVAnm98mU8ILWS8XC4d56oehDCDn3oDAac7KLfJNXrYyjd47hnZAUDVwNPArN7P/Wwocir+GuG6nQhETWkhJriRwi5rvXkprhh5NVhJrT5K7sECMOZiKiveN0bQxRYxzZLJhsOMGvcpSqWRLlZaUneWP7RWqC9zGUm6AgHYoZfLxM/zrKvfCMZjAN8yJOPTp8L0Vp5tQT1Pg== 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=5aeOYJhcDD5SPNxOcdeeogc3up7vH+dTVXG+e4FoQwo=; b=Z/tNnPu7Mrku22uplufPZhcdOffWeQHhwJA65ikpQcDfHe5KNLKstx29Iwd0EEWlRDgpSta2oIycebzIcsP7mzR4AIm55ExY3FBs0jptQscUBE09ZU5P/4QExbYrkVXRL4VXVLCZnMdCjxDzxB2rJWDdBT8cP9B0isfT82z6I57vPwbByU5HR9aTKXVvvpsTpWeHPQ1NN1Mj0V7Qk7MfcJROdEZ4+9TylcZJTP2MiUXQ5AAOamoS0PlAvolNwKmEM4vdybTK8gJrDHzjqZvcXYKhEfB5vFOws12MJz5QHts0NdD90do4Y2X+CHKK7Y1+rfqvyJjA8pSmVim460K/zA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=networkplumber.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5aeOYJhcDD5SPNxOcdeeogc3up7vH+dTVXG+e4FoQwo=; b=NjjltROYm4s1883v3QD9B83+eiVfn23wUn1Pj4E22xl4fvkZZ4mRlPVenr+QBRkAQ+ZEO/1GSnwtIVsi6LTomxpDIeWjH5OgyQVIHV99LIARL5Q7HaNKr9c0KcGEAnAhPN60YCGk4cz2xF2JpaUNLsnQHoDSmV8T8Y2NVko8LmmKB4E5K/G/uv8vvTfYnpyjnvUuqroMkdha/QZMdnqR12Fqh3baLjA+JzvFnNiT1k4XAzWsN0fTo35wqLDgIXrZSCh8fyDhSpVlbxzse/irPclE0Aj8SAY9kV+Suan89tIczKTa1NF5WuSviifung1yvPz1fyX+frtiOAnIPNQwCA== Received: from BN0PR04CA0081.namprd04.prod.outlook.com (2603:10b6:408:ea::26) by IA0PR12MB8423.namprd12.prod.outlook.com (2603:10b6:208:3dc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.12; Sat, 7 Dec 2024 08:10:27 +0000 Received: from BL02EPF00021F6D.namprd02.prod.outlook.com (2603:10b6:408:ea:cafe::6a) by BN0PR04CA0081.outlook.office365.com (2603:10b6:408:ea::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.10 via Frontend Transport; Sat, 7 Dec 2024 08:10:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F6D.mail.protection.outlook.com (10.167.249.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:10:27 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:10:12 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:10:10 -0800 From: Xueming Li To: Stephen Hemminger CC: Xueming Li , Bruce Richardson , Chengwen Feng , "dpdk stable" Subject: patch 'app/testpmd: avoid potential outside of array reference' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:53 +0800 Message-ID: <20241207080055.488538-96-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6D:EE_|IA0PR12MB8423:EE_ X-MS-Office365-Filtering-Correlation-Id: a37317ac-a12c-499c-a45a-08dd16969c0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700013|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?VmwjkNv2HBFwacm2k+PMoYhfs+uEd834ZZVtNLwqep5n8FUsOonGPEg5I0Uc?= =?us-ascii?Q?qSzI5hGplq+4XEzMXmI/V2q3Wg3CB/CwSeUdsElG0GWY5y0IJI4I3zYT/IeP?= =?us-ascii?Q?MU+7MSqS4qyYYvYFEXRQf/ia2NBprDIKne3x1eY6+ImactB+3TFbi5fh3mzb?= =?us-ascii?Q?ioEXznnceGA63nJofAWuWCAfJp4wq/G5AC8zuo5uAnoDff8i+RV5kTinTlN8?= =?us-ascii?Q?esiOfsLDuVXUxH6lm9KNloPrI3tkzEbFmXeGYDjIEqOUwQ/8BYXz/DJQwN/b?= =?us-ascii?Q?pzs554beZJednCy9sMkzucDLHVZZpaw8M3vnYMhQ6mUkDugs3WC443m961Au?= =?us-ascii?Q?DM3N5OIQy1SCiqAcJggf9TVBb63hczK2pPuM7SKDBx3CqC5mAncFJxlQRBGj?= =?us-ascii?Q?ZuVuMvHI6Jmo+7Nn9/3zsjiObMp0auNUaJPTCed1MDQS/+1W85TuhvOYmWu/?= =?us-ascii?Q?jpafW5GMHAywdqkBIt/v/ZZm2anbc+yCoua5+mFtMhp/H12U3Mo3NffsrdyG?= =?us-ascii?Q?cREOLDsiv61/pbW7c0m5a7b6wLIEzMEErqAZ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Ld63+XCvc/K2MU?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:10:27.3426 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a37317ac-a12c-499c-a45a-08dd16969c0c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8423 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=747ba3671e05f61b7113fb767a1394a6fb34a5e8 Thanks. Xueming Li --- >From 747ba3671e05f61b7113fb767a1394a6fb34a5e8 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 21 Nov 2024 10:23:30 -0800 Subject: [PATCH] app/testpmd: avoid potential outside of array reference Cc: Xueming Li [ upstream commit f86085caab0c6c5dc630b9d6ad20d1c728e7703e ] The order of comparison is wrong, and potentially allows referencing past the array. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: 3e3edab530a1 ("ethdev: add flow quota") Signed-off-by: Stephen Hemminger Acked-by: Bruce Richardson Acked-by: Chengwen Feng --- app/test-pmd/cmdline_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 4b13d84ad1..661c72c7ef 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -12111,7 +12111,7 @@ comp_names_to_index(struct context *ctx, const struct token *token, RTE_SET_USED(token); if (!buf) return names_size; - if (names[ent] && ent < names_size) + if (ent < names_size && names[ent] != NULL) return rte_strscpy(buf, names[ent], size); return -1; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:47.208956809 +0800 +++ 0095-app-testpmd-avoid-potential-outside-of-array-referen.patch 2024-12-06 23:26:44.113044826 +0800 @@ -1 +1 @@ -From f86085caab0c6c5dc630b9d6ad20d1c728e7703e Mon Sep 17 00:00:00 2001 +From 747ba3671e05f61b7113fb767a1394a6fb34a5e8 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit f86085caab0c6c5dc630b9d6ad20d1c728e7703e ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +23 @@ -index 1e4f2ebc55..9e4fc2d95d 100644 +index 4b13d84ad1..661c72c7ef 100644 @@ -24 +26 @@ -@@ -12892,7 +12892,7 @@ comp_names_to_index(struct context *ctx, const struct token *token, +@@ -12111,7 +12111,7 @@ comp_names_to_index(struct context *ctx, const struct token *token,