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 5A1E143CAB; Thu, 14 Mar 2024 08:06:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67AD542E75; Thu, 14 Mar 2024 08:06:14 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2103.outbound.protection.outlook.com [40.107.220.103]) by mails.dpdk.org (Postfix) with ESMTP id A3BC242E65; Thu, 14 Mar 2024 08:06:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWyQBX2QpxWyDSOZMY0A3kUqEFvQjl96fmii9KCc4FeIYXp9SpJ+IYji8jyxalrdKFD/6w6A2vCLAA+KyMssoHw0f8c9d3wyleFA3AfXb1oUklmurkxxe25EkDTSIfEC9NbSSrPwhRW6MZ8Ea+0jMa29LxMPfYKiypvOMcMlbAmPBoW5TslrS+cj9p5iw+QanwkRfgDD9ojFnOUZb2ikKk5iqVAeRWFCqBMbdOARMNftzlHTDdoE/LiODIKzpXiy8TtM5xetVu5zxf++kvSZ81zPhmLd8Hjxg1Rj8Eag05cLGP8K/1C62j/uTuADNObkxHE3GRzM5iKP1csrSMFmfA== 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=BwFvcVIgZ63g6V7COMni6F7LTygVBmrveKeYdFd94uRVQRwS6pCKHTqojIjqcBtOcmT8aJLiN6TI0eDaUSKeCyerByj9vMRpWuoIymqh9dLPqyfk8Jl014waOm3FJnOL59sM68ktt0aq9wj7rxtghyMCkFtd/afiXoOPSgxKXZNXiGwnDlCQog5jAd15vAR6yhwq4bxPTu2/CUgb1qkl3zLWFLVSvGEeUlIlrhMxBc++wxNGyu6ZvQZeHr7gUkvrJc8l4eEaKTeWf51V+60LzPKXk7WLXbR/QFIrxdYV5bXaNyCsRFVh+cg1QHq9GKkoLEQVBOxGC/XRJGovo+w7Aw== 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=Bz275hvd8zOS/Qy5tr2SAFyVMcWTtjUVzT/Jf9IZBNjaujlxY3vwDHCGvlVOWznov9a5CyC+VcOQJWHoayIVqLKp07+A2Wy/jLUeSnuEy8FfVsm8R7wJdZUoNCbaFngxFikM2wfJvd2uFU7e02CUtHqqcOJa4DXHBXepy3xKvas= 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 DS0PR13MB6235.namprd13.prod.outlook.com (2603:10b6:8:115::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21; Thu, 14 Mar 2024 07:06:11 +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:06:11 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , stable@dpdk.org, Long Wu , Peng Zhang Subject: [PATCH 6/8] net/nfp: fix null pointer dereference Date: Thu, 14 Mar 2024 15:05:34 +0800 Message-Id: <20240314070536.3169210-7-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240314070536.3169210-1-chaoyong.he@corigine.com> References: <20240314070536.3169210-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0191.apcprd06.prod.outlook.com (2603:1096:4:1::23) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DS0PR13MB6235:EE_ X-MS-Office365-Filtering-Correlation-Id: 63a77d99-cb00-459f-19cd-08dc43f53a65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MIntDV/lZ/Q7xcp9PcnfK3sfQCJBzHkyy07e0ICrkZGM4e25sZ+GRSPaWfuPxe8S3CYmclGMLf6mCdNilniHMT9YUypjyvkcaCp38yVVwlr9BSc9Rm8JDS+ewhemMFV0Xs6g5TzjZ5YgGNGBRe85Cww+pfS3oljd/RchWp52T647meJYabV6y6Xq+ly5ml4QIcmv8x/WMMjG6G9+3iALHLsGWbV8NTat9zpjS/+Q3WzjyHbG7VTz5muZJalPlOXqKO4lV0z9KwbyvQtQQaf0kwFa3yCLmugJb0DmiCc4mvtTo2jz6pBKaj3W9Ej/sN6pxP+deS+zDjdIKk1fjSScZKQY0LM9u1rzoXu9gAJ0ig9hw9gG/TC7KeyRfOT1eH/6XU19XaR4b3Ncyu4CdehS8B7nEnzYOtiRHzQNjJU3GWMWUsO83X2+UWAZUHpzXXjA7sjLqnfVG9in914TGhe3bCt96RysckkB4izxPh9HMx2qss4sLRikKgJVwWBK2Dv/dyYZYMWrJD1oHpEUsOFFpINzR9+spZAuR5r7rUpL9RdL35zo0slNl1bkTeq+jr3yhJZDIdRwHiF+NIDBlbGfhIYBnqg+25J8B+hx3d8+V34DJEfFNcYZxesf8tYcfBoVZ9zx4H6XahXoGk6I6c24CE13K7e5+D1mOBmoRpuy8GwEJC1sXVUM67lPUe2zKmuT/Z+ZZykWExxsu5LLFh7Ei3ClYM73BkYMj5Tk9YaDuqU= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rgwV2vGIZ1si4ugtT5E6o1sn2AYrvnm4JGtPZIMNxbnCT8BoQnu7ncNazRqW?= =?us-ascii?Q?SCs5HUq3s6iH13DP/aC8I12UcFJ542y+6ExPCVSBIK1hW4HbsloxA8JDz0zg?= =?us-ascii?Q?SqjmujEMUkKpOz6ZuYBSccUMn/Wawp2eVzhhOmK7ipSmX71/X4KUy7SD+X71?= =?us-ascii?Q?ZfRPriv89/ijV3xlr9U7EcIT2wGttE5MSWBrrsEMGnSGLzRSNY9ZG+pKri06?= =?us-ascii?Q?33dj2at3GrsloUMKmX5ES1NdIX1H7rvlAbFM5haCxAgVZ7tgY5AJ1IgLW7Zb?= =?us-ascii?Q?dP0QI1/m1Wwdy55UJdr9Bkkab47Qoo2/+K2wAgyX6BETFaYV47R4A+Optr+H?= =?us-ascii?Q?sjAw/bTwUjK7jeeJn2BVW4cT6JxiHJS15HN01NAp5//hSyXNXrWHx6GeiBEb?= =?us-ascii?Q?rBp8MlBc/ztHRy+7xeRWTDWMeaYq/tNQ130+92kDvsCawRI06H6sQSnVrElx?= =?us-ascii?Q?FqvonWoxxWfI9oxnFk6R5/npHMCtBagwNswsOOAnp0/kXZp1H0eASrHABQFw?= =?us-ascii?Q?O+yaojTCip7nnmjaxNqCXJv30yBsBK2iCwB/zlAmC7ewD0HtiJgSxL+clIF6?= =?us-ascii?Q?Nw1p1opkRIcAYXa7FMgcVMADzoVGKya0htjomUHJ2HVnEFsK3NLnT8nfX47r?= =?us-ascii?Q?w1QOhshGL3z+IpwvaXnfsRMABbVQmPMry4HCV9v4nXsE5C9dvi5Zd0Fkef2z?= =?us-ascii?Q?iApJXzzUGMKKNnDmoNGsp4196j7ZXUtwq3ElNo5HdNjWSeD23QjbjWl3DIuB?= =?us-ascii?Q?GOi6VAFiTnWyvMdMfpbGS/LpNzpb6YfrNck0vz7piAsJv2YbfrloubXako4U?= =?us-ascii?Q?XybEla5mGR6sv1hW3JgbpuIVjYj6NwwFbTBB4R9f8usXTJxeQcLtstCEalCH?= =?us-ascii?Q?uFj9TuHjqK58G0p9TLWxDC/gkm8BH6sObpggjq46Rm1TqMoiihVCdSLccMTi?= =?us-ascii?Q?NbNkabPE+tNYhatS3u5n6DY2S/LkfULAZSsHigCM8D++frXpbClHGMLLJpkh?= =?us-ascii?Q?IkTB1UOJAzpecv+o64Dwsr5xFnGNdq+4iukq3fpa/1N5KiuHeOY+EhpbKLus?= =?us-ascii?Q?Xa97SF99i/TMI32F1Aa2hHoSdBvhtexxdW8gntPwCFiF8HTlP69xjVG4KUd1?= =?us-ascii?Q?oK5MHukNIbR2gRRJ8mLGVCCCekA32LKrs5c/6dWZEfoAKHkhcbluV69MbB/F?= =?us-ascii?Q?5sm8uUwLPl7/XlrBJ96/egQTsk3m3vv3Wuu1tECNMQMfM8PP/wzbZd3UzgEN?= =?us-ascii?Q?uxzvwQN5Y6+tS5ehqusd4dzunZOPVpxPsYOumiFhRDz3yIGn7F+NrVnzyzny?= =?us-ascii?Q?H3zZB0RoJICPamE9jBW3ygAKmNPn66wrZuj4OqvBjKO4RITxDc5xFF98RZaZ?= =?us-ascii?Q?Yqso4ZFS6Noe0dY/ce6f3sJYmVQ3/ny3qjkCsuQXIghTh1uilKQOI+FkKIxO?= =?us-ascii?Q?0PRBrXICZ3R+jw4VqRJS8xgeP8fK0XtmomPMLeZkCHJH4bXQs6RSEkZnJNWr?= =?us-ascii?Q?Fll3YXEWpYskvbQi7ZGRV+OvjDc4PaBmEmVvVixHVQGhtF/YKd925nyPWB4Q?= =?us-ascii?Q?LDUpGwiTPfCQicx+WSPC+PGVTksjJ5PFv7zD8H1E90/4PPBV0ERvrtwUbji0?= =?us-ascii?Q?Hw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63a77d99-cb00-459f-19cd-08dc43f53a65 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:06:11.0953 (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: 7Xp4gLxHL/ggmm19EjNFIJ3E83Z8gHNDGt5pKZqV8SZpaEHRmkP2W2N4W37EAbZkKjxI35ppmLMAdlL1CVfcMlgyeSFArjeXD7Up7duTK0g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR13MB6235 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