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 DF18545B6A; Fri, 18 Oct 2024 18:36:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CD0E74027C; Fri, 18 Oct 2024 18:36:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 0593440268 for ; Fri, 18 Oct 2024 18:36:30 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49I9ROgp008930 for ; Fri, 18 Oct 2024 09:36:30 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 42bm18h1v0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 18 Oct 2024 09:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i4Qa91AJrDyYULlHvMSZDJ458/esHubooyNhTocveNL+xleg+i0DK6/oxULY9Ul9zsDc3HrbYRkMk8s/F8G731CIAUoU/FyXbwOYoha+/eoUIkM9u+f9R1+XtW7aPPGLiiaI4nq7EX/v4zNNd4dDCsijfXb7tz1jgcbxAXiaLAShZnExkU5T/HUUXphdvUdAlom/e/W/Xqksu9Rp5fL2XmSyMdsPyXH81iBAPqMLmGcd2smCxJiJpCKxQPH3V4Q9NeSLrt0mdSvflkxOZePmY1bPHScfnr29aviDwHFBJqFZEWHKzycDYSvY+y+js+PY4hsYFvOPgOt1CRoV96Q5Uw== 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=O7WAo6OH93qasWMFHE+YUkRiL19M2lv5g+ThhIWbRLw=; b=rzhxXcm0KgQTAvzOylE1uax4xvgIgVXtekYHAMfGGD5WOwUDLpn3CS7VGly3gch4AXCkObJ6ftCCFLOEaj81mg2gCYJXvvTvROJA81YD51IZxJyIQ3z26VwWWejTMZ/HlesNwPgxEyvrfEag4faezOmMQ+yrRlScgoUZSfmILxXUcw1RzXKEuKnO23jvBWvfSAwX3tf0oel3iBHs8JfVRVNVHG74lEqorz/9/kKMzTDdCK7241kBfXFp7QZCPrTI8XqFWVKK2RBeCh8/+We18o3pG1DuayVeKgjXklYSL2UV1KLNedB1ZmyUIzXdIUyQOeT0opm2yNBfBYiz8JKc4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O7WAo6OH93qasWMFHE+YUkRiL19M2lv5g+ThhIWbRLw=; b=Br36mUtBdZ6wVMGzvG1Ty77aqgMRfqx0Om1Nvj9khNok381fRITPyoHyENVEMZoGhzTUWddUsRbEEsBFQqHeNtYJdxbV7CD8MMpHfyx7s7j4AZliDwJ2m92FKbAs3KvVUcfo7udzpcdR5nfsRGjueKADJka6c0pweIGResOxLLE= Received: from PH0PR18MB4086.namprd18.prod.outlook.com (2603:10b6:510:3::9) by SA6PR18MB6203.namprd18.prod.outlook.com (2603:10b6:806:415::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.24; Fri, 18 Oct 2024 16:36:27 +0000 Received: from PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::ed37:4ea0:6359:f717]) by PH0PR18MB4086.namprd18.prod.outlook.com ([fe80::ed37:4ea0:6359:f717%5]) with mapi id 15.20.8069.016; Fri, 18 Oct 2024 16:36:27 +0000 From: Pavan Nikhilesh Bhagavatula To: Hanumanth Reddy Pothula , Jerin Jacob CC: "dev@dpdk.org" , Harman Kalra , Hanumanth Reddy Pothula Subject: RE: [EXTERNAL] [PATCH] event/octeontx: resolve possible integer overflow Thread-Topic: [EXTERNAL] [PATCH] event/octeontx: resolve possible integer overflow Thread-Index: AQHbITOnxSFFdRvqwEuxPKL6TufUB7KMtOSg Date: Fri, 18 Oct 2024 16:36:27 +0000 Message-ID: References: <20241018075903.53757-1-hpothula@marvell.com> In-Reply-To: <20241018075903.53757-1-hpothula@marvell.com> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB4086:EE_|SA6PR18MB6203:EE_ x-ms-office365-filtering-correlation-id: 7ca3a939-f958-48b3-0156-08dcef930339 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?P9T8sNBizT6te0cox4tsaPuIwf3kzUsc+ivwDkk5Wdd6DPKKsDzdUd+0F8QU?= =?us-ascii?Q?gneK7PZInKM0VZTlFRgvVIaAdkxFimi3ZdrDtHsfat7L34jswwuTm8AKnGFq?= =?us-ascii?Q?z902DIfivfSuSaYNcsDzf9O1K53czGGAIuGlVGj+//CK4W1LLGULVnWJGHEC?= =?us-ascii?Q?gcM/dhWM77JBZIcMQ+N1TSF7fT2XVdUhqHdeekBOjM9magYf8HGZpQmHMobW?= =?us-ascii?Q?sv+96NM1wjlAm1zSliitFXVNdv22zdRQjbF0nn4CZlHardK72RrNE5RakW30?= =?us-ascii?Q?e6NTONztcAGPKtQ0XeDsGCwG0Ee3nz+BRC24aPRhdjuPi8HJ+tBR79MlFg4R?= =?us-ascii?Q?avGR3aYwEIzVnMMommXQsSM8JLbAaL/vp46MMVyaFm5H+eGu9eNlmwwM8IA4?= =?us-ascii?Q?bH8nA48D0nBb2u6sqSRYOB44qTf/l+YtK8PNS8NH671dAW0K99SO3cezbtX2?= =?us-ascii?Q?QSOeZSTVNv755JcTr3zBVtPwQW8sjiOIouP/95lDgzJgxyov4TuDfPIwW4U5?= =?us-ascii?Q?JATLI0AZ2hcIWZkN9JCfG+zS1W6HMQT5F5iaspswqcYyJfbFmCzg/v5EaK6O?= =?us-ascii?Q?KWshMRhQsdpFFaSNUIGBipQC37+2JiUO3q0aUc5hpxDkxkJG8CcV1b9NHzN+?= =?us-ascii?Q?erDuD6DbVcVuIV4G1zo732wa8Zqt3xcwz3gic3fp8wECey780NfGG9YIsHxG?= =?us-ascii?Q?EAKJ/pf6edPOb3FyEVKCLfL/oH71DixdQs3VxMc8ojjH35HlrPL0vKwTjtEW?= =?us-ascii?Q?s7ikXYyCTwfzdtlNiU6GI7rvcBgWL6htV1kpSyvvs2anqvlGGzYE0cJ9AqOU?= =?us-ascii?Q?xoL5YtHHEkD0WokPEl93wslYH0JJEPHcQBBa6Q6V58sxGorzPa8kOvIL8+7D?= =?us-ascii?Q?AjWCrswi6XQm0ypSTR+sQb1HYElZo/dsPob62os3h7vSgEwyUnWkOflO5JFK?= =?us-ascii?Q?kv7InNUTzmuYsCHl4iNS9OmRZHGLnc1Ipenes1ZchlDUiZOIEEiZz6yW/3iR?= =?us-ascii?Q?+vphzWisWSy3CN0FTFErgoAK5tP1+f5UNDxtXn0YHB0778qUexpdF8ynCCAZ?= =?us-ascii?Q?0PsuoJ87FZ/nBNvmkqYdMbxfOpJp019Re44Ib0usL+dmqlkVf7elqc2xgchw?= =?us-ascii?Q?oJOfSrLM1Fc7SrBGb/bplrG5HVqKM6vtLkPPBvzVqNTc4GRutGhOeX++VLdm?= =?us-ascii?Q?6250Ky9RLjTnYCZvpiPfFukMpDSftY0MbinlD/p5ZLxSJW4iLTR27Zp4n1Wi?= =?us-ascii?Q?V9J7HkwAYjvtoNqJuxc8S21QuZN+gYVJhf8AD4213LL70YVGivMoHY9Vybvb?= =?us-ascii?Q?uUIuxJ1urEbJRTpYcv7rUUDQBEjalMhHYqkZpIOCvcQF/C7nkLTUn3Lz8M2l?= =?us-ascii?Q?lJjg3gw=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB4086.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?L/leVtbl6VD2JGOop49nQC3gNbEV1sqrJJNc2BZXjY2oPlAfKXyiUhr/TjJR?= =?us-ascii?Q?RRpl4zHWS7qihVQ1hc11hXhNtfcL89nizYrOUUYqqiAiYE/p5H+vw8Y0j5bn?= =?us-ascii?Q?6f6bPAq93q+2gSwG8Y8cJvmGXBhMeVy5r5UIT/STsUrGfaVFruHaM5JpMsWB?= =?us-ascii?Q?2jPZ48UvD3qyY3WSmAYjH7atF/lVN8PFwhldKne5yWeVq732o6OWFc96Ftjt?= =?us-ascii?Q?dC5LOb/uoBeaILan00Il7jQ1TgssLlA16eUeap7MyJFyZBT4iJ2jsSqMqHoB?= =?us-ascii?Q?R5zy3VfgAkomw/N4DAm7z0+3/osPIWtdyv8DBzOU+szQ+oB2J62Czs1lDvMe?= =?us-ascii?Q?e7ykeexFimevJ+nVq+8GdejTcXuco+VlKNjhmN1XjJi30PVe33Ou4s3CO1If?= =?us-ascii?Q?Fz6X8bBSpAFny+RNvG91ls5VssWho6EAuYyMQx/H+8krQe87E9OklZZozQoT?= =?us-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XkA1CsD0dSjlxCxOzU?= =?us-ascii?Q?Ld0xCzAmdStx0sDixiF5hCPS+HOePvaFdnV/LbD5hDuQkFGS/juM1t8DdZI/?= =?us-ascii?Q?5HRNLT8JrmBwHZ61nmJ6Bj9wm4GXESKDc8SjEq9d/2zo7uoq+uK85HnZkJx0?= =?us-ascii?Q?VD4p07C20RWf1tycwjvr4WKeVYofz3dgVxfLD9DIEOXNt48+uaj/wY+nELd1?= =?us-ascii?Q?26vIaLlOXoR772P6uJB1EMO8Z2WrTD4DkYx1QXlu?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB4086.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ca3a939-f958-48b3-0156-08dcef930339 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2024 16:36:27.2609 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sQh+HgjPgM8OY9OjM57ZrIVx38wpyGLQ/h036JuakK9cGYykZodnRqod5eSLgbHqVIWbq1LjeT0picmv2mR7lUexvAS+Pq2CsbLXeFFMwGA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA6PR18MB6203 X-Proofpoint-GUID: u50PB7Ke87HmWSTy9uO_NB_-4_eVBZjr X-Proofpoint-ORIG-GUID: u50PB7Ke87HmWSTy9uO_NB_-4_eVBZjr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 > The last argument passed to ssovf_parsekv() is an > unsigned char*, but it is accessed as an integer. > This can lead to an integer overflow. >=20 > Hence, make ensure the argument is accessed as a char > and for better error handling use strtol instead of atoi. >=20 > Signed-off-by: Hanumanth Pothula Acked-by: Pavan Nikhilesh > --- > drivers/event/octeontx/ssovf_evdev.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/event/octeontx/ssovf_evdev.c > b/drivers/event/octeontx/ssovf_evdev.c > index 3a933b1db7..ccb447d33a 100644 > --- a/drivers/event/octeontx/ssovf_evdev.c > +++ b/drivers/event/octeontx/ssovf_evdev.c > @@ -719,8 +719,16 @@ ssovf_close(struct rte_eventdev *dev) > static int > ssovf_parsekv(const char *key __rte_unused, const char *value, void > *opaque) > { > - int *flag =3D opaque; > - *flag =3D !!atoi(value); > + uint8_t *flag =3D (uint8_t *)opaque; > + char *end; > + > + errno =3D 0; > + *flag =3D (uint8_t)strtol(value, &end, 2); > + if ((errno !=3D 0) || (value =3D=3D end)) { > + ssovf_log_err("fail to get key val ret:%d err:%d", *flag, errno); > + return -EINVAL; > + } > + > return 0; > } >=20 > -- > 2.25.1