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 EAB8345505; Thu, 27 Jun 2024 02:43:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A67D1402E5; Thu, 27 Jun 2024 02:43:59 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 8727D40272 for ; Thu, 27 Jun 2024 02:43:54 +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 45QImdVo002148; Wed, 26 Jun 2024 17:43:53 -0700 Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2041.outbound.protection.outlook.com [104.47.73.41]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 400rkg0uan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jun 2024 17:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQ+Md3oQPxtpSbqWFRzY1igfzJ3O85+Lrcq9Aqz6VSI/Y3k2w/32L7Ts+S2zXimxMW7DZmOU7HStJt6S3mO6ln0eu5qEeb7GrLyfPd4MbwDM6D4drehOjfS1uTq/BsGRtk9vLL0+klWQYbHpybcxupFK2gWicsOlXnbG5Cu0Z3v2+Q8jVikYjG6G2nR3VoyWpmQpxIr/9LDZ9E9g3W7zQnjvoec541tbdB59cEJh/dFpTPl6vqx77uvUxHU13ianQvjbYZGFSIQoaz/L3xfzttWl5+G8oCRULVcIVwxcyl2E1IPO+hquHYMYot4o0W8n2XnMQSNxCJEhXzq2wprroA== 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=dxjTuAenK2nif+cSEa1vaqygXXnyYv4YwLSJVbcBK44=; b=mvZZwZn+RHHmO0QmIPpddSC+zMjOH36KnzvC4wGF6+Py7mf4QEnSfXBgIHtHC3m0HllUvwlDV4xUntflDhNDIMA2amiYORVjSOOBvYlvU9BF6qhc407Y6Pe9X8m/2XdmcWDj8KZWnyc7Na3cDtMZBZJLqbrQKF46SIBjaO4XtDrOD0XzkKiBH62jqX2ABfHM9DocNbutXFN8/MWYsVptytf4nuOCMlcGvF2m6Qqq6F6eALy8nxBTTcb8lmlLCOh6Rx7/8/MQCW/FlPW1J8OAeYXeAJVEvBPX7UHAKtRCxUGwjlEE9RkMsh3Svg6fC3WWpd+GcSpdg9uOUHM6qxmSfA== 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=dxjTuAenK2nif+cSEa1vaqygXXnyYv4YwLSJVbcBK44=; b=ErmMjjW2DrNeDrajktBxkUFnVHgyDVb/l6EuKceH27jPUcKHukLpVdTKvqmrvT7pL4Thz9+nt8v3Q6JIVLhUeXRx1k1SqN0XaIuNekpz6sw4wRwnd6iT0wrpkGEP538ZAebzACKT5TUvz/M4vje/siC3pV1fKT4uy//bNfJZWUc= Received: from PH0PR18MB5071.namprd18.prod.outlook.com (2603:10b6:510:16b::15) by BN9PR18MB4140.namprd18.prod.outlook.com (2603:10b6:408:135::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.33; Thu, 27 Jun 2024 00:43:20 +0000 Received: from PH0PR18MB5071.namprd18.prod.outlook.com ([fe80::25e:7:91b:8f1c]) by PH0PR18MB5071.namprd18.prod.outlook.com ([fe80::25e:7:91b:8f1c%5]) with mapi id 15.20.7698.025; Thu, 27 Jun 2024 00:43:20 +0000 From: Kiran Kumar Kokkilagadda To: Mahmoud Matook CC: Sunil Kumar Kori , Rakesh Kudurumalla , Nithin Kumar Dabilpuram , Jerin Jacob , "dev@dpdk.org" Subject: RE: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too small Thread-Topic: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too small Thread-Index: AQHaxnFT15USl8WoeUa204kwv5pmh7HX5snggAKYcwCAAEl6QA== Date: Thu, 27 Jun 2024 00:43:20 +0000 Message-ID: References: <20240623200921.1715890-1-mahmoudmatook.mm@gmail.com> <20240624200114.1792214-1-mahmoudmatook.mm@gmail.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR18MB5071:EE_|BN9PR18MB4140:EE_ x-ms-office365-filtering-correlation-id: 77b65257-03f7-455d-1821-08dc96422483 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?B?c2FtdWJ4UjZIUkcxRmlnRDgxcjh3anFGdmd3ak5yRkVNYXdmbFc2TDcwR0pT?= =?utf-8?B?NEdzYjhtbVJ2cEQrdENGa0ViaTd0R2QzcTZZL1JkYXZIU3hBSFhMNWxEYU95?= =?utf-8?B?emJidUNYT2d0Q25MTytHWUxYb0NzMTYzajZTenVUTHB5bVVTNU1YN1BrczYw?= =?utf-8?B?ZEQ3M3luejI0UjhuUHZ5cExLZ2xEMFJPL3Nvb2R6VE1aZ0pyL1hsQ2cvQStJ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c3VwdFBj?= =?utf-8?B?cEtGWDRiWk0rS0xEaG5XclBaL3ZncUJYYTJiZjM4cVBlUEZieHVQMHAvbG8r?= =?utf-8?B?VmZNZGlqaWovVlZseUlZc1FSbVVsR1RrcFVheklYWVVrZjdBcWUrSUhZbFc4?= =?utf-8?B?ZXo1L0pXeG95Qzlkc3dUMXQrTjJOMDlZR3BacCs4b0JxRGVZcnRlY04wZTR4?= =?utf-8?B?RE0xODBQY0ZVRkl4N3I3aGROMUpwSUJNUWkrbm92ZGF6U21rZTgrYks5V1FJ?= =?utf-8?B?UGJIaEp5aW9QaWJTYzh0NUloYzNMaElxUEh3UGdMQllaR09oaGlXNXQrNHhH?= =?utf-8?B?Wk9la3dCa1pSNU1oOG1qZC9mNnlRQ2crVGhKV1UyVWlJWFdOOE1KWmorK3Ey?= =?utf-8?B?K01talEzQUJ4K1BjS0NrUVU4OFo3MGMvWFFyazh2QXpLNGZOc2x4L1VFMHE4?= =?utf-8?B?K0dqMHRBQmR0dWczMUwwUWZUR3NidWM5OSszWHRUVlpNMFd2TDFhQVRMMk1N?= =?utf-8?B?TVdUOW9zazljRWlWTklEY3JoVnMvZ2hzUE1wL0tXdERVN1p6a0xzcHVlUFQy?= =?utf-8?B?OG91N2hMK1pXdlNMUVc5TmNZWWRuTC9NZFEwd2pMVHZHem4vSlJvSlBIcU0z?= =?utf-8?B?V2M5TzFiMlVvOGV3YjdES2d3UXRIN0REM2VGeXp1QkZydVpxVWtNQkhRaUJO?= =?utf-8?Q?k6sciCuJn/IFtEIGuljQ9CKcK0PvngL2O/Ue8=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR18MB5071.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?WlZBQ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8?B?UEhpMDArYlF4YWwwZ2g2S2JoeFFhdytyczRxencvMldLNktKZTZWRnFNWHh2?= =?utf-8?B?S01ncWlCM2FwTDN3QUFaTGxXbWNTSXpNZ1laZERISEk0NzNzWi9MZUFMQTF2?= =?utf-8?B?cktzQ1RVN2lIaU9DZXBiaTFwcTN2cDVFSU1UT3pyTFdjNE9HNGVpVFJ6NW5K?= =?utf-8?B?bklONUNGYXExTklCbmx1R3FnSi9QSGd0NFdhWXo2a05qUitiRDA3Q2phemVB?= =?utf-8?B?WHdnOFRTbUlwelEvUzc2dkx0cFBqLzVLeHloUnl0ZzhPL1dEOTN0aXVOZTRE?= =?utf-8?Q?kl0i8w2FI9qmTwAwqdK2KHdkj?= MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR18MB5071.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77b65257-03f7-455d-1821-08dc96422483 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jun 2024 00:43:20.4267 (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: SnxsLN6epjyahOyG8G5UGXr0sbdY4vA0EZmCCgqqGi/OeSXQTkxUimpoyltvY1575HAcGKUGyuPChlu1S+IXsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR18MB4140 X-Proofpoint-GUID: TnY_XcWurRPAn9hNGfFRoOIFbwBWITV3 X-Proofpoint-ORIG-GUID: TnY_XcWurRPAn9hNGfFRoOIFbwBWITV3 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-26_17,2024-06-25_01,2024-05-17_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 > -----Original Message----- > From: Mahmoud Matook > Sent: Thursday, June 27, 2024 1:49 AM > To: Kiran Kumar Kokkilagadda > Cc: Sunil Kumar Kori ; Rakesh Kudurumalla > ; Nithin Kumar Dabilpuram > ; Jerin Jacob ; > dev@dpdk.org > Subject: Re: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too > small >=20 > On 06/25, Kiran Kumar Kokkilagadda wrote: > > > From: Mahmoud Maatuq > > Sent: Tuesday, = June 25, 2024 1:=E2=80=8A31 > AM > To: Sunil Kumar Kori ; Rakesh K= udurumalla > ;=20 > On 06/25, Kiran Kumar Kokkilagadda wrote: >=20 > > > > > > From: Mahmoud Maatuq > > Sent: Tuesday, June 25, 2024 1:31 AM > > To: Sunil Kumar Kori ; Rakesh Kudurumalla > > ; Nithin Kumar Dabilpuram > > ; Jerin Jacob > > Cc: dev@dpdk.org; Mahmoud Maatuq > > > Subject: [EXTERNAL] [PATCH v2] app/graph: fix destination buffer too > > small > > > > as sizeof(config.=E2=80=8Arx.=E2=80=8Amempool_name) is < sizeof(res->me= mpool) we > > should copy at most sizeof(config.=E2=80=8Arx.=E2=80=8Amempool_name) an= d replace memcpy > with strlcpy as mempool name is a null terminated string Coverity issue: > 415430 Fixes: 3850cb06ab9c ("app/graph: > > > > > > as sizeof(config.rx.mempool_name) is < sizeof(res->mempool) we should > > > > copy at most sizeof(config.rx.mempool_name) and replace memcpy with > > > > strlcpy as mempool name is a null terminated string > > > > > > > > Coverity issue: 415430 > > > > Fixes: 3850cb06ab9c ("app/graph: add ethdev commands") > > > > Cc: skori@marvell.com > > > > > > > > Signed-off-by: Mahmoud Maatuq > > > m>> > > > > --- Acked-by: Kiran Kumar Kokkilagadda > > > > v2: > > > > * replaced memcpy with strlcpy > > > > --- > > > > app/graph/ethdev.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/app/graph/ethdev.c b/app/graph/ethdev.c > > > > index cfc1b18569..e7a02b40a9 100644 > > > > --- a/app/graph/ethdev.c > > > > +++ b/app/graph/ethdev.c > > > > @@ -16,6 +16,7 @@ > > > > > > > > #include "ethdev_priv.h" > > > > #include "module_api.h" > > > > +#include "rte_string_fns.h" > > > > > > > > static const char > > > > cmd_ethdev_mtu_help[] =3D "ethdev mtu "; > > > > @@ -671,7 +672,7 @@ cmd_ethdev_parsed(void *parsed_result, > > __rte_unused struct cmdline *cl, void *da > > > > memset(&config, 0, sizeof(struct ethdev_config)); > > > > config.rx.n_queues =3D res->nb_rxq; > > > > config.rx.queue_size =3D ETHDEV_RX_DESC_DEFAULT; > > > > - memcpy(config.rx.mempool_name, res->mempool, strlen(res- > >mempool)); > > > > + strlcpy(config.rx.mempool_name, res->mempool, > > + sizeof(config.rx.mempool_name)); > > > > > > > > Can be changed to strlcpy(config.rx.mempool_name, res->mempool- > >name, sizeof(config.rx.mempool_name)); ? >=20 > mempool field is of type cmdline_fixed_string_t (array of char) >=20 Ok, I over looked the "res" type.=20 > > > > > > > > config.tx.n_queues =3D res->nb_txq; > > > > config.tx.queue_size =3D ETHDEV_TX_DESC_DEFAULT; > > > > -- > > > > 2.43.0 > > > >