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 5372D43829 for ; Tue, 5 Mar 2024 16:36:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DE37415D7; Tue, 5 Mar 2024 16:36:10 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B68C2410D3 for ; Tue, 5 Mar 2024 16:36:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709652968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pG3PO+1fuPDnmVq1xZ5maMGzZxQEGAp0n+Ei5NfKf5E=; b=YOdu1jNK25i0kdLCtRYJVzKBOayBk7AKxL5bCbnzCmfysTv4b3gFiDT4/cIrNHCQZf8r7p 4Fsy3o5dBV9LfbAYrE1tfWP2u0CPLx5KtAaWmnJKljvMMmDFCSsW4In29LylcPZZ4o2SZJ zxDQ1lIz1DzbzxoesVNSwp5Y6g6G/+8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-210-UM8nKO9MOMiOhXOFPCIPlw-1; Tue, 05 Mar 2024 10:36:02 -0500 X-MC-Unique: UM8nKO9MOMiOhXOFPCIPlw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 440B928C97C9; Tue, 5 Mar 2024 15:36:02 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9427F2022C24; Tue, 5 Mar 2024 15:36:01 +0000 (UTC) From: Kevin Traynor 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 21.11.7 Date: Tue, 5 Mar 2024 15:34:23 +0000 Message-ID: <20240305153449.263666-50-ktraynor@redhat.com> In-Reply-To: <20240305153449.263666-1-ktraynor@redhat.com> References: <20240305153449.263666-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.7 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/11/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/15d533ce941f245389f87d1fa3bf91c5d30264ef Thanks. Kevin --- >From 15d533ce941f245389f87d1fa3bf91c5d30264ef 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 [ 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/pfe/pfe_ethdev.c | 3 ++- drivers/net/tap/rte_eth_tap.c | 1 + drivers/net/thunderx/nicvf_ethdev.c | 2 ++ 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index bae6c5abf2..3bf356fa2c 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -352,5 +352,6 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, - RTE_PTYPE_L4_SCTP + RTE_PTYPE_L4_SCTP, + RTE_PTYPE_UNKNOWN }; diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index d79d069120..309336eec3 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -204,5 +204,6 @@ mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L3_IPV6, RTE_PTYPE_L4_TCP, - RTE_PTYPE_L4_UDP + RTE_PTYPE_L4_UDP, + RTE_PTYPE_UNKNOWN }; diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index a1c800aaf8..2133fb7717 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1783,5 +1783,6 @@ mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L2_ETHER_ARP, RTE_PTYPE_L4_TCP, - RTE_PTYPE_L4_UDP + RTE_PTYPE_L4_UDP, + RTE_PTYPE_UNKNOWN }; diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c index c5158bbf31..fe48ccea8e 100644 --- a/drivers/net/pfe/pfe_ethdev.c +++ b/drivers/net/pfe/pfe_ethdev.c @@ -537,5 +537,6 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, - RTE_PTYPE_L4_SCTP + RTE_PTYPE_L4_SCTP, + RTE_PTYPE_UNKNOWN }; diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 29b4860656..3a11f36e6f 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1838,4 +1838,5 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_SCTP, + RTE_PTYPE_UNKNOWN }; diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index fc334cf734..a177bca3ff 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -311,4 +311,5 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_FRAG, + RTE_PTYPE_UNKNOWN }; static const uint32_t ptypes_tunnel[] = { @@ -317,4 +318,5 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) RTE_PTYPE_TUNNEL_VXLAN, RTE_PTYPE_TUNNEL_NVGRE, + RTE_PTYPE_UNKNOWN }; static const uint32_t ptypes_end = RTE_PTYPE_UNKNOWN; -- 2.43.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 14:08:55.837293658 +0000 +++ 0050-drivers-net-fix-buffer-overflow-for-packet-types-lis.patch 2024-03-05 14:08:54.685520858 +0000 @@ -1 +1 @@ -From 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 Mon Sep 17 00:00:00 2001 +From 15d533ce941f245389f87d1fa3bf91c5d30264ef Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 2e3ddb568044308b40f60fdb2ddc62160b95b1b1 ] + @@ -17 +18,0 @@ -Cc: stable@dpdk.org @@ -25 +25,0 @@ - drivers/net/nfp/nfp_net_common.c | 1 + @@ -29 +29 @@ - 7 files changed, 12 insertions(+), 4 deletions(-) + 6 files changed, 11 insertions(+), 4 deletions(-) @@ -32 +32 @@ -index bb2de5de80..cf73f9d50b 100644 +index bae6c5abf2..3bf356fa2c 100644 @@ -35 +35,2 @@ -@@ -364,5 +364,6 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev) +@@ -352,5 +352,6 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev) + RTE_PTYPE_L4_TCP, @@ -37,3 +38,2 @@ - RTE_PTYPE_L4_SCTP, -- RTE_PTYPE_TUNNEL_ESP -+ RTE_PTYPE_TUNNEL_ESP, +- RTE_PTYPE_L4_SCTP ++ RTE_PTYPE_L4_SCTP, @@ -44 +44 @@ -index daa69e533a..212c300c14 100644 +index d79d069120..309336eec3 100644 @@ -47 +47 @@ -@@ -199,5 +199,6 @@ mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +@@ -204,5 +204,6 @@ mvneta_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) @@ -56 +56 @@ -index a91509d92a..82cb8d5368 100644 +index a1c800aaf8..2133fb7717 100644 @@ -59 +59 @@ -@@ -1778,5 +1778,6 @@ mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +@@ -1783,5 +1783,6 @@ mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) @@ -67,10 +66,0 @@ -diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c -index a438eb5871..c907d9d5f6 100644 ---- a/drivers/net/nfp/nfp_net_common.c -+++ b/drivers/net/nfp/nfp_net_common.c -@@ -1366,4 +1366,5 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev) - RTE_PTYPE_INNER_L4_ICMP, - RTE_PTYPE_INNER_L4_SCTP, -+ RTE_PTYPE_UNKNOWN - }; - @@ -78 +68 @@ -index 551f3cf193..0073dd7405 100644 +index c5158bbf31..fe48ccea8e 100644 @@ -81 +71 @@ -@@ -521,5 +521,6 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev) +@@ -537,5 +537,6 @@ pfe_supported_ptypes_get(struct rte_eth_dev *dev) @@ -90 +80 @@ -index b41fa971cb..3fa03cdbee 100644 +index 29b4860656..3a11f36e6f 100644 @@ -93 +83 @@ -@@ -1804,4 +1804,5 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) +@@ -1838,4 +1838,5 @@ tap_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) @@ -100 +90 @@ -index a504d41dfe..5a0c3dc4a6 100644 +index fc334cf734..a177bca3ff 100644 @@ -103 +93 @@ -@@ -393,4 +393,5 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) +@@ -311,4 +311,5 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) @@ -109 +99 @@ -@@ -399,4 +400,5 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev) +@@ -317,4 +318,5 @@ nicvf_dev_supported_ptypes_get(struct rte_eth_dev *dev)