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 E65E745634; Wed, 17 Jul 2024 13:05:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4722427CA; Wed, 17 Jul 2024 13:05:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mails.dpdk.org (Postfix) with ESMTP id 90F6C427C5 for ; Wed, 17 Jul 2024 13:05:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721214339; x=1752750339; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=wVHgzv+fsy+mV9pf+A5x+NlDMPFdHOnDnYRju9qrvFg=; b=S6J2N1g6/ggMBg11579nYS0vHYHM6lJVBIJmmYWu14NOP3HfwlhXEDYY Tdq7kFisqm4OgEiDmr2NDzlZ9sYgyEVj8ar6sqG1XkoFVsTu+4tS7eveN 5KNnxUFbByLN1FHO4XvxHs+R3O/4Rney9e0V5V10AjgVvcEla8u2B+rSv z0K7jkhXb9n1Gl2IFo67qNpyGx7T1Dou23YF/MKIIZJmhb957wUihWCZ+ MGse8G0tg0XqZ4IVj63+SAPSEKcWMc2V/o63hRpBS6z4ZqH3DqIe44Rhq AMGxJuZ08PW1+f95BhKYPmURzzmRiRncGPOFycMdg5n7ufSUsVFBpKnNN Q==; X-CSE-ConnectionGUID: 3VijdsOCTtyCtiFm6Afi2w== X-CSE-MsgGUID: 4//6odLLT56WgnyzUVORyA== X-IronPort-AV: E=McAfee;i="6700,10204,11135"; a="18557261" X-IronPort-AV: E=Sophos;i="6.09,214,1716274800"; d="scan'208";a="18557261" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2024 04:05:38 -0700 X-CSE-ConnectionGUID: 2PuBYd4LQHyyaA2AgtkieA== X-CSE-MsgGUID: 3FYPSs53RLiRR/qQ5AP5Jg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,214,1716274800"; d="scan'208";a="50232672" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa010.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Jul 2024 04:05:38 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 17 Jul 2024 04:05:37 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Wed, 17 Jul 2024 04:05:37 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 17 Jul 2024 04:05:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ij7JvItcycqlKO2vqezuX+MzPES3pHuzJhG1sAz1UFSi3H9O8rfmzadRzuwwWbI+6HI8STVn206KnzTR9H4w01/LDLZh6ZBZ/3kEVuwiHt4M4+tAixjMnhY5F1dn9dLTIpxMklGTc0a7X7xiScWawq2UBQn3UijT+9wmlFgPH0E3hV98Pb7H5JX98r3tMYxTTvGllMkXpFi7snEp0JfLsByeWx7+oYEE2aYYyKrqKlmQdwchwPZGErQydUh6C8eIBeapKnR8ob3Gw3nEtPfKmAcXOiU641E+B/JIdjvfpp263spbiz6qTX8MZKxV6vgn737yIIwlAkLX9Rx39+BQSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tE18Dg+/37ZslGrW0pRLqQvewB4Ve44HA/u4ke6f0Kw=; b=pg+jpVJ/igCb+OMxNPQWf46YyaFPGm5gSDPaZi3Wt8+/FOdDZ63rdyELbywJBgH07Stk+Kp/sIFloGjK+DYAsEDElHGR/cv7qag3+jIAh/vUVbeMXCrCiAXY2XzI1FW4Bg64n7JpXDdtlhwR3olwZT3RhDKMNMpHEsl79i9dP8VA9FrfqMVUGaZ0cM61/naxW0sIjyRZf2fn2dnly5ms6cCAZFWmqj4ph/hg15Yyu9wABeRkp5xPWmajnusmrOPxpR6HXdlzfTOgjXXLv2lfvvbC9kbiNpCa9E/0vcoIg/lk7Ei5iqlUE3v3toEAZjxuyiL2QF0BnlRE0mboRKAV8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by MW4PR11MB7077.namprd11.prod.outlook.com (2603:10b6:303:223::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.25; Wed, 17 Jul 2024 11:05:29 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%7]) with mapi id 15.20.7784.016; Wed, 17 Jul 2024 11:05:29 +0000 Date: Wed, 17 Jul 2024 12:05:24 +0100 From: Bruce Richardson To: Vladimir Medvedkin CC: Subject: Re: [PATCH v2 2/3] net/ice: refactor raw pattern parsing function Message-ID: References: <20240711165907.3169191-1-vladimir.medvedkin@intel.com> <20240715180441.3682734-1-vladimir.medvedkin@intel.com> <20240715180441.3682734-2-vladimir.medvedkin@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240715180441.3682734-2-vladimir.medvedkin@intel.com> X-ClientProxiedBy: DUZPR01CA0052.eurprd01.prod.exchangelabs.com (2603:10a6:10:469::8) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|MW4PR11MB7077:EE_ X-MS-Office365-Filtering-Correlation-Id: 450a2d4e-c3f6-4d21-55d8-08dca6505e9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vfwFaCalPAK2KCI0lHI8G2MqbWjsHYR/3xIeD2OqMMqZS11den/D56TgRs06?= =?us-ascii?Q?eq9FqzTSWRprFQvxiscZzfPYYiEoUnC6YxXoVntJuT7ffb3GBYzYq7ZHaTzf?= =?us-ascii?Q?L9S/Gbq6WHYI32uRstgtwxtDDmUQqqavnyKaciof1DdlpF9BzVYnkxbxgRPZ?= =?us-ascii?Q?oxlDQrk+eSFpbBj0K3Cz4oB+yzFC4Q/JOX3LoJE7m+XWAlEX6P+YsLY0QCtl?= =?us-ascii?Q?ktohblANAoZ4uUKwTrfc5sIuud7ZdCm5Y+9xHdoQ87x0JQBpVXEh/atsm1mF?= =?us-ascii?Q?ixc6B7QbJEbZJOE4nuwJnr4rjOe/NzIuq/j7395n1EGT80fYwSlttbC/81aq?= =?us-ascii?Q?U/+0LUIqrtxjuystdPuexO9Asip7LRSnjfXdIKcuI/CmQ1RegoZSqFLcScF+?= =?us-ascii?Q?S5N4ZwbVLpxm+jV5+zhSbJdTtmgbb+jBCLM9VvlN+Xwjl327UkuIsFjKAecp?= =?us-ascii?Q?g4gsQC9UKajtunw2vPXcwZJPcxgo9cr0Y6hRJESKGoNUb7YDH4C2avzdAgTE?= =?us-ascii?Q?a32xHmnMxUyJLIsG7y54NEobZwqsTPgxwwk3029AILyVva92Xl81rsTxwluP?= =?us-ascii?Q?zm8/iw7GfPdOvcMJzMDjX2ihYQwoFC+Z203ylXsUyfwrWWhp57UDf9apY+Gh?= =?us-ascii?Q?VvNhkXGXcaLWmsoa0nhuTGubbRpZA+oJrins37bA83mB2DqAJ7mSqqz70xHL?= =?us-ascii?Q?/7PD0snx4Rs9J8oAN13aS0M/OBnz2url3/KL4P9yDToBnkcvgpbMBAWVVwSF?= =?us-ascii?Q?T4a8+8NosaROcHpjvWo/tqWcKRbtuI/toRdIMYCFjTL5XMw3+/D3LIWD7Vie?= =?us-ascii?Q?HNdfymQvtW09vmkJ5qD2DoM4/cxX67wsheB0d6TD8fjnICae354HfJe/vIx1?= =?us-ascii?Q?z/ETP1PPFVL4wLrRbBeOAHBX6x2c7+P6uMyLbakTnQ0tjJqyQslXdTQ5nEQX?= =?us-ascii?Q?LHlU/GU30RdU8Joud3Vvez21aKncRKfrUXF3jIqHGDtJlwS+W1gvYB1Cn/+N?= =?us-ascii?Q?wRNI6q0Om+LRhvbwrzVy5E+rOtaDi67xEo13uhNr6uGLKytlF9JOfchTqRDK?= =?us-ascii?Q?iiKcWySm1lv0N7xPllb08rYsCnOE9eU047FveuBr4L70jkzCt7XNBdPu0nJH?= =?us-ascii?Q?oPWvD5GtLY5789jTMmtcftdvIcNtz5LoS1DO2FTjKXDCDgPEtSpwdKG2MYyv?= =?us-ascii?Q?/879t4hZSLK1UMwOCA9QKuoiQTHbG94J3IIQy8Gibyo4IF+Iz9U4Pic7iACs?= =?us-ascii?Q?ofOofifhKqpuGjtpG4ame2x6plk+hdCS3mNEN/35XV52VDbzLYTJJdNgsLOs?= =?us-ascii?Q?bF67cc0gGHkjjusxLx+Fe2q09vg5+8zXlNkMQBGco/TIWg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cKk2CC3BU0pNbvfcG+rIwJHKeyVKN5RsSwcM9iQ6b5Zkbw4M5TpxMJEnfw0U?= =?us-ascii?Q?ffHZNqIAaGi372sRynkvOU/wr6aRErrXzLPBZ9cbhdUNt9h5h64yan3e6hV+?= =?us-ascii?Q?DMXvViSzT+oC00SAkJCgUfMbzlY2xkeWN6gTYsBchRf0m86dBrB8VVwctEsT?= =?us-ascii?Q?SYCuU58EH4+ecxlXxs0jywpYpX38NnZhEffGqJsatqcnXgDfmjA6DasAs7WD?= =?us-ascii?Q?ITDL3iIR3ihgYA7Gj21+DykPhAutZMlzqs6NHtnOpo8DA4IptR+Mo1snGZM9?= =?us-ascii?Q?HvtHGheQzxfsdocGetEzUswxjyS9G7vxqdw5oRz9tJDkdZ146TcnahBMuYPh?= =?us-ascii?Q?9Jq3ex12VXa0pUYGoRfPX6qYlkn2VLUuSkhhALHXqYUwnVbzIgNNducEmsk8?= =?us-ascii?Q?bONtVeqbcD7qYAXpet9eV4sP5CnnG7u4suoPLKMYFlQX/5Cak96ZGP3YJLDR?= =?us-ascii?Q?MyvNGR3imtIfsDjMMVFGLTxp8Ca91/xFJ+p8utpgW+j3tryRxHL5rmuE1bPQ?= =?us-ascii?Q?Obp5h5/MokopMjCc5ac4JxEMWzWn1ShQVUH3HeiXJhS2UJh3N2ZPzP1yLQ+V?= =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Qoo5dkzLUGo+3FzJP08G?= =?us-ascii?Q?dyH71fY1ef1ESgoRmBUJ27Nhw7lrNjuWn1KWjKMYYSHfQGfk08uiXMFboqb7?= =?us-ascii?Q?s3Cy8C3eqp9ZSvsgZxC4kSi/VqXFhbQApnRtgM4hMPhkrU3EE6+Brb8TmaIq?= =?us-ascii?Q?vw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 450a2d4e-c3f6-4d21-55d8-08dca6505e9c X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 11:05:29.5652 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LeCdNNCt+UJ6IruM2suoUCSHgPhskDBRy1x4OdFTYrhhN5t5HC24JuZIzFSJIhzCVMthsJl/TJ1QN62KpPOgtzOzuxYsIjcs6MFAgkhxlz0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB7077 X-OriginatorOrg: intel.com 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 On Mon, Jul 15, 2024 at 06:04:40PM +0000, Vladimir Medvedkin wrote: > Replace strlen with more secure strnlen in ice_hash_parse_raw_pattern. > > Signed-off-by: Vladimir Medvedkin > --- Acked-by: Bruce Richardson > drivers/net/ice/ice_hash.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c > index 913f54fca4..00503d0d28 100644 > --- a/drivers/net/ice/ice_hash.c > +++ b/drivers/net/ice/ice_hash.c > @@ -658,9 +658,9 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad, > raw_spec = item->spec; > raw_mask = item->mask; > > - spec_len = strlen((char *)(uintptr_t)raw_spec->pattern); > - if (strlen((char *)(uintptr_t)raw_mask->pattern) != > - spec_len) > + spec_len = strnlen((char *)(uintptr_t)raw_spec->pattern, raw_spec->length); > + if (strnlen((char *)(uintptr_t)raw_mask->pattern, raw_spec->length) != > + spec_len) > return -rte_errno; > > pkt_len = spec_len / 2; > -- > 2.34.1 >