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 216DBA034F for ; Tue, 1 Mar 2022 11:45:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C51A426F1; Tue, 1 Mar 2022 11:45:06 +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 BCE8A426EA for ; Tue, 1 Mar 2022 11:45:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131504; 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=YYE+vR1ylB4v5AbyAeOMMIgRjgZ0+GeyE6W3z3yOECg=; b=Ba9oYkdFCOHUaeYgGNlIrBYZz9Gsr49wWtOcY9diKf0R3hdyNmcxUw8jQj2yBmj1xKxnbJ WEynh/0EkxWY/ETZM1yXmCf2+R++DSLbSxC2nT8Q4ZGzNYmJL/pKXkVcIT/BAjwcZMh8R3 41mBZitOSumHeBmzTpFyWiNB3ekq88g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-cS55KBkwO_K55rvZc0J8EA-1; Tue, 01 Mar 2022 05:45:01 -0500 X-MC-Unique: cS55KBkwO_K55rvZc0J8EA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A87FB814615; Tue, 1 Mar 2022 10:45:00 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E9B66FB02; Tue, 1 Mar 2022 10:44:59 +0000 (UTC) From: Kevin Traynor To: Gowrishankar Muthukrishnan Cc: Jerin Jacob , dpdk stable Subject: patch 'common/cnxk: fix uninitialized pointer read' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:42:10 +0000 Message-Id: <20220301104300.334382-54-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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.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 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 Acked-by: Jerin Jacob --- 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@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)