patch 'common/cnxk: fix uninitialized pointer read' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Tue Mar 1 11:42:10 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.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/06/22. 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/f0cfb0e3d1be408568122ac971800375ec47e37c

Thanks.

Kevin

---
>From f0cfb0e3d1be408568122ac971800375ec47e37c Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Sat, 12 Feb 2022 18:08:20 +0530
Subject: [PATCH] common/cnxk: fix uninitialized pointer read

[ upstream commit 244a996f0149c2c3ae82e0bc6cc2abc4eb87656b ]

Fix uninitialized pointer read reported in coverity scan.

Coverity issue: 370214, 370217, 370219, 370220, 370221
Coverity issue: 370223, 370224, 370225, 372065
Fixes: c34ea71b878d ("common/cnxk: add NPC parsing API")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Jerin Jacob <jerinj at marvell.com>
---
 drivers/common/cnxk/roc_npc_parse.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index 8125035dd8..4f915f3692 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -39,4 +39,5 @@ npc_parse_cpt_hdr(struct npc_parse_state *pst)
 
 	/* Prepare for parsing the item */
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.len = pst->pattern->size;
@@ -76,4 +77,5 @@ npc_parse_higig2_hdr(struct npc_parse_state *pst)
 
 	/* Prepare for parsing the item */
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.len = pst->pattern->size;
@@ -122,4 +124,5 @@ npc_parse_la(struct npc_parse_state *pst)
 
 	/* Prepare for parsing the item */
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.len = pst->pattern->size;
@@ -180,4 +183,5 @@ npc_parse_lb(struct npc_parse_state *pst)
 	int rc;
 
+	info.def_mask = NULL;
 	info.spec = NULL;
 	info.mask = NULL;
@@ -308,4 +312,5 @@ npc_parse_mpls_label_stack(struct npc_parse_state *pst, int *flag)
 	 * that subsequent labels do not have anything to match.
 	 */
+	info.def_mask = NULL;
 	info.hw_mask = NULL;
 	info.len = pattern->size;
@@ -313,5 +318,4 @@ npc_parse_mpls_label_stack(struct npc_parse_state *pst, int *flag)
 	info.mask = NULL;
 	info.hw_hdr_len = 0;
-	info.def_mask = NULL;
 
 	while (pattern->type == ROC_NPC_ITEM_TYPE_MPLS) {
@@ -359,4 +363,5 @@ npc_parse_mpls(struct npc_parse_state *pst, int lid)
 	info.spec = NULL;
 	info.mask = NULL;
+	info.def_mask = NULL;
 	info.hw_hdr_len = 0;
 
@@ -406,4 +411,5 @@ npc_parse_lc(struct npc_parse_state *pst)
 		return npc_parse_mpls(pst, NPC_LID_LC);
 
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.spec = NULL;
@@ -493,8 +499,8 @@ npc_parse_ld(struct npc_parse_state *pst)
 		return 0;
 	}
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.spec = NULL;
 	info.mask = NULL;
-	info.def_mask = NULL;
 	info.len = 0;
 	info.hw_hdr_len = 0;
@@ -652,4 +658,5 @@ npc_parse_lf(struct npc_parse_state *pst)
 
 	/* No match support for vlan tags */
+	info.def_mask = NULL;
 	info.hw_mask = NULL;
 	info.len = pst->pattern->size;
@@ -710,4 +717,5 @@ npc_parse_lg(struct npc_parse_state *pst)
 		return 0;
 
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.spec = NULL;
@@ -746,4 +754,5 @@ npc_parse_lh(struct npc_parse_state *pst)
 		return 0;
 
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	info.spec = NULL;
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-01 10:41:02.866989486 +0000
+++ 0054-common-cnxk-fix-uninitialized-pointer-read.patch	2022-03-01 10:41:01.339244105 +0000
@@ -1 +1 @@
-From 244a996f0149c2c3ae82e0bc6cc2abc4eb87656b Mon Sep 17 00:00:00 2001
+From f0cfb0e3d1be408568122ac971800375ec47e37c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 244a996f0149c2c3ae82e0bc6cc2abc4eb87656b ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 302ab66efc..b849326a19 100644
+index 8125035dd8..4f915f3692 100644
@@ -23 +24 @@
-@@ -113,4 +113,5 @@ npc_parse_cpt_hdr(struct npc_parse_state *pst)
+@@ -39,4 +39,5 @@ npc_parse_cpt_hdr(struct npc_parse_state *pst)
@@ -29 +30 @@
-@@ -150,4 +151,5 @@ npc_parse_higig2_hdr(struct npc_parse_state *pst)
+@@ -76,4 +77,5 @@ npc_parse_higig2_hdr(struct npc_parse_state *pst)
@@ -35 +36 @@
-@@ -199,4 +201,5 @@ npc_parse_la(struct npc_parse_state *pst)
+@@ -122,4 +124,5 @@ npc_parse_la(struct npc_parse_state *pst)
@@ -40,2 +41,2 @@
- 	info.len = sizeof(eth_item->hdr);
-@@ -237,4 +240,5 @@ npc_parse_lb(struct npc_parse_state *pst)
+ 	info.len = pst->pattern->size;
+@@ -180,4 +183,5 @@ npc_parse_lb(struct npc_parse_state *pst)
@@ -47 +48 @@
-@@ -397,4 +401,5 @@ npc_parse_mpls_label_stack(struct npc_parse_state *pst, int *flag)
+@@ -308,4 +312,5 @@ npc_parse_mpls_label_stack(struct npc_parse_state *pst, int *flag)
@@ -53 +54 @@
-@@ -402,5 +407,4 @@ npc_parse_mpls_label_stack(struct npc_parse_state *pst, int *flag)
+@@ -313,5 +318,4 @@ npc_parse_mpls_label_stack(struct npc_parse_state *pst, int *flag)
@@ -59 +60 @@
-@@ -448,4 +452,5 @@ npc_parse_mpls(struct npc_parse_state *pst, int lid)
+@@ -359,4 +363,5 @@ npc_parse_mpls(struct npc_parse_state *pst, int lid)
@@ -65 +66 @@
-@@ -548,4 +553,5 @@ npc_parse_lc(struct npc_parse_state *pst)
+@@ -406,4 +411,5 @@ npc_parse_lc(struct npc_parse_state *pst)
@@ -71 +72 @@
-@@ -641,8 +647,8 @@ npc_parse_ld(struct npc_parse_state *pst)
+@@ -493,8 +499,8 @@ npc_parse_ld(struct npc_parse_state *pst)
@@ -81 +82 @@
-@@ -800,4 +806,5 @@ npc_parse_lf(struct npc_parse_state *pst)
+@@ -652,4 +658,5 @@ npc_parse_lf(struct npc_parse_state *pst)
@@ -87 +88 @@
-@@ -858,4 +865,5 @@ npc_parse_lg(struct npc_parse_state *pst)
+@@ -710,4 +717,5 @@ npc_parse_lg(struct npc_parse_state *pst)
@@ -93 +94 @@
-@@ -894,4 +902,5 @@ npc_parse_lh(struct npc_parse_state *pst)
+@@ -746,4 +754,5 @@ npc_parse_lh(struct npc_parse_state *pst)



More information about the stable mailing list