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 A0BE343CAE; Thu, 14 Mar 2024 08:41:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3F5942E8E; Thu, 14 Mar 2024 08:40:59 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id A71B942E7D; Thu, 14 Mar 2024 08:40:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBVoxwynR7W882wvXoX4xnqVzGMn1Q7KGURpL6YwYbskgAhsc4xXZlrywHYAvQXwpsicwhKUqxcx+zq91JfJFb64majavoVEDi3JYDYusiP7CpOUWiJ8R5bMDJYoxPJ+StApVep4xq95j8il8fLVnN5bw3Fx/qh1tPeEzJ/X17Ww7aND2G1djyoyjrfHEmiL/VZneAWMmpNdfKURFETAN+jO848mOS2PBAuUblsbRTE0/BJNSw9GkhYlPBVl0K4g4exzS/lxpM+qsUU1uhvByO64/SS9dxx4zMCxjRBKx5lzOfd58E9I/plZGutm5Hw5yVXhSY3z0urAuTJqtnifrA== 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=R1vFhZO3XcS0xmnG8doqo3d01BUp6K+oMMUU0Cpnai0=; b=kqmLs1x9dB8p6D5ZRben8DpiQyKg4cy8bHQlSmlcHxaf+oeFFUnhvHdmAQRq6xL1sGEMVD6q4jzU6qKQ6Xz6eybVX0DxkeZEZ7OGka0vYodgW5SvzByhnlKn4XZmAQOLsHL8X0vsN6+YYmQqb04NsusmeNpTWR4yNwBygXQVya64jpvV2jYflr79eQ2c7IRriyWJArP1wQ4dfIiFwZuP+Ll7KXxFDBLcGiq5VSrzy5XMp67XMWDAFyBVE8rop1SzfgqeC5xV4GJmTgQpe/uEnEQJ+r+krSxvBAOPlLON4BAItM7BzTlSDU0gWnHe+lyGa3vouLIS0IIDBHl7v8HjqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R1vFhZO3XcS0xmnG8doqo3d01BUp6K+oMMUU0Cpnai0=; b=GWN4Z32fe8vnn7DkqrLPRR2QL5CpcR7HTYhyhiNBUFv0ZaR1zNASeH4QM958S/E1JF5uBbmMXPe0VkVW7whYAU2tRPqeMi/1FDhz2XIpVRnDbA/edZw5FrPMAwH4+RwKCTCnAXcxe0HoIskNo4KPvAtUyVHvKM0IlqQmFzd8CFw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BY5PR13MB3617.namprd13.prod.outlook.com (2603:10b6:a03:21b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.19; Thu, 14 Mar 2024 07:40:55 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ec12:7411:559a:850e%5]) with mapi id 15.20.7362.035; Thu, 14 Mar 2024 07:40:55 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH v2 6/8] net/nfp: fix null pointer dereference Date: Thu, 14 Mar 2024 15:40:22 +0800 Message-Id: <20240314074024.3199555-7-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240314074024.3199555-1-chaoyong.he@corigine.com> References: <20240314070536.3169210-1-chaoyong.he@corigine.com> <20240314074024.3199555-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR11CA0107.namprd11.prod.outlook.com (2603:10b6:a03:f4::48) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY5PR13MB3617:EE_ X-MS-Office365-Filtering-Correlation-Id: 1761ee24-ba01-463c-af7e-08dc43fa14d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B4rbOmG/xhxI3sF7mfmtI87Uag207MLilcBqCA/AfszHTZLXEHuTfW+g7U/3uC6SEgym7vttr0h4Y+B3W69SVN4PcBShxnrzWfw0AV/e3CNeO8xjqk52FWxzDXVXgb2DyiZ3VHbgYZYaJBxy/TVJgOE987OtTBbegC8DjcdsL7mjcYioyB+fZ61gvK2c2BgmSPx8t9bdl0AiYcL1K/0TawgaqTAVMUgp6lNxVbzgstanl03D3A/1MlmnHOnZwjj2y+RzWedAzsxbTEis4FAIPmlkABXMsGvqLpYz8gEqJ7/hhMbnYPZTUJ9CCwC4NcnqnH2i7CcLNhfwHuxGAvkMTyOVGulDRuWmL+f0CIOlGlyx9g9xHu86dD1OUgAovPpDQI/BDBp21QX9xt/IsnlQU2dT2NlFgp7z1C/kUa5fIEKQKUw/P/caXcD9sxUXCbgLF2/0ZutgPbTfxcoYZKlEil7/1w8104o/60yoAiokJ5nGpfl+ye8Eke6pdSYKbX0b1iVuG7/xYuiEUcn5CBg9FzK6cxflB7SB+HXViq43VogGPATsp0vSx96oGbd3/zNhSGdrFCCaAs8t/O8SjNdelPEuwtLnF+tjymjfgytikWjyGsTrQ21ef+JtqijI4TBlIqBGFHgF7rntp7v07BN0joHfmWCfdAnoHaDsqKf6LasA5ozjsXW+wD8T43kGP8wZDuV735+A2pe88rLB5++NjU35gKy/xyfSqhS687ME5eI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(52116005)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bt38YTJZ3j0jvpOU4zBh+od9su7bc2jYaE6Sgo1FzStI2b/gEqgP82lCiFOv?= =?us-ascii?Q?qnIgrDpoA/mS4Z2RF5wk9gG8zWrlJg/FpoF8m1+d6jtbEl6nXRpiOE6j0qDF?= =?us-ascii?Q?kSzWeRc/97mmi7JspNqTmREU+PiMFWkqev5lum/tNGUryx+Y7j+eRCFFWdfL?= =?us-ascii?Q?+WPGoHACg6p2lAzJqQj776RtTOWT3tFwAZR8UfGUThBzuD+Bhs+f4/mOOjAE?= =?us-ascii?Q?Fajtpb+Omok5xxkXtcr9ZSCscj3q4GBYrYHyehA+LYWO0WzT+t054kCuUHYA?= =?us-ascii?Q?eIeVbatNcTtTerXIuYvhnjq0LBUXDOG24hMAudkjs2mhMyW/yunlyjkRyhsU?= =?us-ascii?Q?qYsQaaa0Kpr355xTvUI5WE7MTHvPgE33dwaMTBDBd9i5ACmb85R4En8qeJkR?= =?us-ascii?Q?Q/PGUvFOdgHh/i+cgblvP7fMa8uz88isKOZ22mycKSGe4sjDavYgjg44D9wM?= =?us-ascii?Q?oX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N46KtP9qWb7?= =?us-ascii?Q?DVNKQjpO+d/dmohZM0y+R/D3gMt08A+Qj9jWpjulPFA75qXhrLaMjZDDmehR?= =?us-ascii?Q?gefizqDxZtkn7ZNvLrskUoEwb/7fXF4gpNuoV7m7qYqP7uysYAwT0yCUSo+1?= =?us-ascii?Q?VGUNUJNYaHR/nqaR5RmK8fLrGA24ZylohO3VmiOeKImIpJB7C6fOref/bavW?= =?us-ascii?Q?XxieRUp335tkqnIWdQ8XvfD6idxYK1OOY+Rju4GfOyjL71NgpMHUiny6Dbwe?= =?us-ascii?Q?/A=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1761ee24-ba01-463c-af7e-08dc43fa14d9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2024 07:40:55.3078 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uCquHPDMuPH56vY6bzOGXWpjYkJ9sWrP98rLA/FcOm3kMgTX5eOv/oluc7Z2Y5bGOAGdRFJH4a973Rn2aXcWUcP4y+SZIVaAW7+xELUOr1Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR13MB3617 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org CI found there are null pointer dereference in 'nfp_flow_merge_l4()'. Coverity issue: 414942 Fixes: 94438b093702 ("net/nfp: support TCP/UDP/SCTP flow items") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_net_flow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_net_flow.c b/drivers/net/nfp/nfp_net_flow.c index 251974edb4..ea743eed73 100644 --- a/drivers/net/nfp/nfp_net_flow.c +++ b/drivers/net/nfp/nfp_net_flow.c @@ -349,12 +349,15 @@ nfp_flow_merge_l4(struct rte_flow *nfp_flow, ipv4->src_port = rte_be_to_cpu_16(spec->hdr.src_port); ipv4->dst_port = rte_be_to_cpu_16(spec->hdr.dst_port); - } else { + } else if (ipv6 != NULL) { ipv6->src_port_mask = rte_be_to_cpu_16(mask->hdr.src_port); ipv6->dst_port_mask = rte_be_to_cpu_16(mask->hdr.dst_port); ipv6->src_port = rte_be_to_cpu_16(spec->hdr.src_port); ipv6->dst_port = rte_be_to_cpu_16(spec->hdr.dst_port); + } else { + PMD_DRV_LOG(ERR, "No valid L3 layer pointer."); + return -EINVAL; } return 0; -- 2.39.1