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 398B143B7D for ; Tue, 5 Mar 2024 10:57:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3506D4026B; Tue, 5 Mar 2024 10:57:07 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2082.outbound.protection.outlook.com [40.107.244.82]) by mails.dpdk.org (Postfix) with ESMTP id BA9A04026B for ; Tue, 5 Mar 2024 10:57:03 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1zSj+qlYUWiYMqdfG5J+2jcvyRee56nfRwqgbSRwuQoCvOIaXJWXA92tEdG2GfXQj6lamJwrBYa9gxk3I5AR1V+uy54tmnVgYkcqTXIPZ9sC118qS5LPuqUqMbOYVN9uXj+kqlkYBiz9EaMd5MSXZIz6+MBpaayxtJbtJX2oEB/+UjGjgCmNMfdvs6UrrUOiOQ/BiIBdSHi5Sp9vSUehDitmPrNEwo6DlWatHs/jhWQfU/GAkZ6Uuc39zpe+dJuhUmL9B263d/wTrTSGcQTTsG2T6DAV2gzrlmcPcC3P7ChdUMFhlT3IsKYL293a5akfM7+Bc9PI3XJJntP75pGfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=nGkttmzamLbRSC4sDSxaqyoGXpload+fV8Bkn7T/5Uc=; b=V3ursSWlV/GNUoClf3VQ0kEHTaJ2OyXk2N/fhRH0/FBZQTgKKagtWLIejawyFDS2Vv8Ci0YzsrxKPTXqI8paGG2W61kW/6XsZd/qz6nejVtVBOwTFmCnZgS56Gs13OD8O2hwXqrqL4kL8qOhJ3+lG48aWK8Jw2VUMBdC/miW2DwzG9s/GLUEU4VzJmfNkiOCojiV8k1oSB9j55M1WbrTjIC8vcn84XCwwQpn4XD6k4U4VY7PcMOMBudcNxnbMNztCxRlAZ3j/a6bCFlLGxe1xISPDTJu07r0fPOsF+I9fUJi3lmj5fFeqVV8R2scR0JsIXnpdKRBfawFKV/BgBbTIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com 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=nGkttmzamLbRSC4sDSxaqyoGXpload+fV8Bkn7T/5Uc=; b=DXGtoqm2XDRUCF2f5ARdPcp6Zb07NG8WXqxT1wwuvHDQNO2P0zw6efz/9fVYLfIA/zgceZ9brpYYTqMa8ypc6xQQM6qUcAfP3fVG3cpESWCCT7iNWZa1f7JRyjcbTwPc9vkSUB11FyHBbOvI5rIgKolM1CqhHeWeIXPyon7DexMW/KSy6dlfeIPgMwYWCuh+klAduTfn7FGH+qXMyGtb9K8MbxJro/VKISgXA+5chX97P48kdVn407/qt9RqXmnqSCcarW+Uxa9CgpkpCSX9EUX2zKRfMUW/olBscBchDzQYOG99S4zWy1vFZZRZxyeLY3m57M/go+LnHJ3sBdn10w== Received: from MW4PR04CA0078.namprd04.prod.outlook.com (2603:10b6:303:6b::23) by MW4PR12MB7264.namprd12.prod.outlook.com (2603:10b6:303:22e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Tue, 5 Mar 2024 09:57:01 +0000 Received: from CO1PEPF000042AC.namprd03.prod.outlook.com (2603:10b6:303:6b:cafe::2f) by MW4PR04CA0078.outlook.office365.com (2603:10b6:303:6b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Tue, 5 Mar 2024 09:57:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:57:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 5 Mar 2024 01:56:47 -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.1258.12; Tue, 5 Mar 2024 01:56:46 -0800 From: Xueming Li To: Sivaramakrishnan Venkat CC: Ferruh Yigit , dpdk stable Subject: patch 'drivers/net: fix buffer overflow for packet types list' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:47:20 +0800 Message-ID: <20240305094757.439387-100-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|MW4PR12MB7264:EE_ X-MS-Office365-Filtering-Correlation-Id: 6268af77-ee10-4931-f16b-08dc3cfa9a94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fK2UyGo4RSN7cOo59VHpN+MtwXGMTrSZjFNdg2NY28X56Xlf17bzi8ZcJg8pTruNt2snBGl9HaivBErakeINef5zMRoWXoB4+iZut5MQxlqQAabJlGpJeITAheCYVgGfu1kI28M+EZCEcpQCZVxgBroaknjZgRJm9l2MDwlPCAM7djaSKKhJsRcaXF+v9IX21FD4oLiZM8upuUCwMPNhb+TJIFGNy9cYKhe4f3Fe6X7x7j3gZLwm8tvPyR8kYUyemlTPM+SiECtYHoC1ZCoC++m6yK/t7AHSGFrsBQQVaUouMLDLmy3HGOFrHtfgUUu3KX3AVV3Er+4twvwbkAibE1OKeI/+LYffKyzZgHyjPjj7vciHbURjysb0AvPYVQZzPz981ZdUI855zpKf1PuNdwQzfgHqEpAYGkaPZCVpGQ6nk85RNzEWGzwMCUHWnetwUliWV/zEE9otOFxxbsgbd7I/ZM/pLJdc7+0RwolKAjZSXgAC2P2B4ScKDWM5pkusmzD88ooO7cekmjgyBEpbn86Izoahk4cYD6zl4Q3kINMKRDgPEivvr+ixNYDp0LZLm8UBhYm8iLWhqCl+NVp+bhK+6twxhkVFOHRxnA9WhLvRquokEnk8pFD0YuRTAR2Z98sOKA1GcCMy1kiff1P0S4WD2rJvCU6QA8i7OP9F7gtoGYuFwi1W3DPodXxTvcmreVZuTTBjkViaSj/A/V6seuD2U+ob4b/rez5FqHJYhGd51u8gyZWhrPMn2BhR5IVv X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:57:01.1148 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6268af77-ee10-4931-f16b-08dc3cfa9a94 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7264 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.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/31/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=db4ba50b3a16b3ee2c41a4e0107544109f87987f Thanks. Xueming Li --- >From db4ba50b3a16b3ee2c41a4e0107544109f87987f Mon Sep 17 00:00:00 2001 From: Sivaramakrishnan Venkat Date: Thu, 1 Feb 2024 15:50:20 +0000 Subject: [PATCH] drivers/net: fix buffer overflow for packet types list Cc: Xueming Li [ upstream commit 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 ] Address Sanitizer detects a buffer overflow caused by an incorrect ptypes list. Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow. Fix the ptypes list for drivers. Fixes: 0849ac3b6122 ("net/tap: add packet type management") Fixes: a7bdc3bd4244 ("net/dpaa: support packet type parsing") Fixes: 4ccc8d770d3b ("net/mvneta: add PMD skeleton") Fixes: f3f0d77db6b0 ("net/mrvl: support packet type parsing") Fixes: 71e8bb65046e ("net/nfp: update supported list of packet types") Fixes: 659b494d3d88 ("net/pfe: add packet types and basic statistics") Fixes: 398a1be14168 ("net/thunderx: remove generic passX references") Signed-off-by: Sivaramakrishnan Venkat Reviewed-by: Ferruh Yigit --- drivers/net/dpaa/dpaa_ethdev.c | 3 ++- drivers/net/mvneta/mvneta_ethdev.c | 3 ++- drivers/net/mvpp2/mrvl_ethdev.c | 3 ++- drivers/net/nfp/nfp_net_common.c | 1 + drivers/net/pfe/pfe_ethdev.c | 3 ++- drivers/net/tap/rte_eth_tap.c | 1 + drivers/net/thunderx/nicvf_ethdev.c | 2 ++ 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index ef4c06db6a..779bdc5860 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -363,7 +363,8 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_SCTP, - RTE_PTYPE_TUNNEL_ESP + RTE_PTYPE_TUNNEL_ESP, + RTE_PTYPE_UNKNOWN }; PMD_INIT_FUNC_TRACE(); diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index daa69e533a..212c300c14 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -198,7 +198,8 @@ mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L3_IPV4, RTE_PTYPE_L3_IPV6, RTE_PTYPE_L4_TCP, - RTE_PTYPE_L4_UDP + RTE_PTYPE_L4_UDP, + RTE_PTYPE_UNKNOWN }; return ptypes; diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index c12364941d..4cc64c7cad 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1777,7 +1777,8 @@ mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L3_IPV6_EXT, RTE_PTYPE_L2_ETHER_ARP, RTE_PTYPE_L4_TCP, - RTE_PTYPE_L4_UDP + RTE_PTYPE_L4_UDP, + RTE_PTYPE_UNKNOWN }; return ptypes; diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index e969b840d6..46d0e07850 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -1299,6 +1299,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_INNER_L4_NONFRAG, RTE_PTYPE_INNER_L4_ICMP, RTE_PTYPE_INNER_L4_SCTP, + RTE_PTYPE_UNKNOWN }; if (dev->rx_pkt_burst != nfp_net_recv_pkts) diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c index 551f3cf193..0073dd7405 100644 --- a/drivers/net/pfe/pfe_ethdev.c +++ b/drivers/net/pfe/pfe_ethdev.c @@ -520,7 +520,8 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L3_IPV6_EXT, RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, - RTE_PTYPE_L4_SCTP + RTE_PTYPE_L4_SCTP, + RTE_PTYPE_UNKNOWN }; if (dev->rx_pkt_burst == pfe_recv_pkts || diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index b41fa971cb..3fa03cdbee 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1803,6 +1803,7 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_SCTP, + RTE_PTYPE_UNKNOWN }; return ptypes; diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index a504d41dfe..5a0c3dc4a6 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -392,12 +392,14 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_FRAG, + RTE_PTYPE_UNKNOWN }; static const uint32_t ptypes_tunnel[] = { RTE_PTYPE_TUNNEL_GRE, RTE_PTYPE_TUNNEL_GENEVE, RTE_PTYPE_TUNNEL_VXLAN, RTE_PTYPE_TUNNEL_NVGRE, + RTE_PTYPE_UNKNOWN }; static const uint32_t ptypes_end = RTE_PTYPE_UNKNOWN; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:33.967243999 +0800 +++ 0099-drivers-net-fix-buffer-overflow-for-packet-types-lis.patch 2024-03-05 17:39:30.873566496 +0800 @@ -1 +1 @@ -From 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 Mon Sep 17 00:00:00 2001 +From db4ba50b3a16b3ee2c41a4e0107544109f87987f Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 ] @@ -17 +19,0 @@ -Cc: stable@dpdk.org @@ -32 +34 @@ -index bb2de5de80..cf73f9d50b 100644 +index ef4c06db6a..779bdc5860 100644 @@ -60 +62 @@ -index a91509d92a..82cb8d5368 100644 +index c12364941d..4cc64c7cad 100644 @@ -74 +76 @@ -index a438eb5871..c907d9d5f6 100644 +index e969b840d6..46d0e07850 100644 @@ -77 +79 @@ -@@ -1365,6 +1365,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev) +@@ -1299,6 +1299,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev)