From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8708BA0524; Thu, 30 Jan 2020 20:09:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C0EE1C032; Thu, 30 Jan 2020 20:09:35 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130040.outbound.protection.outlook.com [40.107.13.40]) by dpdk.org (Postfix) with ESMTP id DF2CF1C031 for ; Thu, 30 Jan 2020 20:09:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I7iMYfRvDBh2MVufzT5k+bEKFrReYo6ePmdi0qGhjAkGLCC///nyOYX/ZxG5fgJzpOlJ40A4LFDh9TjJKpfanWpqgIfLHGQOOwoUW54VzCVXlpY6YEAKA4PLX7dgq+HFbc/UhtEkK7QbgCfMWtrU4ng7BLso3Jykj4hIwd0to1MyhVKb22sk5AZUdFsNaPx4o9cLPB8GTvzOYGjnJayog7gp/chSFo0asj6BI2FZ+N60K4g89GkxvE3SLs0G+dtrYKmHtk74T+Cy48fSIrRAMczrbPoqDEiw9ZN145y83OICRGYO4cd7ZvYEZa/Hah8qO9cn3nBfXfHbsK0SXv+Dyw== 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-SenderADCheck; bh=AtPPF13qpEftDM73qSHEAdWB/R5lNYkZ5qqDVD4PSUQ=; b=aCcJYwTwhfjN3nf0rwzM55gWhLPiXbacy+yx4p1Axu2acKkJZ37OHVnvsOOxBH1zOkQiQqjuS1V9pr0fDQfmaSWIUxOKeMISTKOjKHWFdpuFBau0UgVMXBLoJ2ajFFJJOKBkjyP4IywUJDHkgmXbAWkskfffheAqOmt/dRqSexyAZ/+Jp3NvpxXsDxGX9wpV0S9lDYV3k7V8ZMTX8p/LHFsnOzuIhAdVhqjyzizXhV6/Re0vg3zmFfDrCa9lh50myLtW8IPLn75AGqn0ZVvPHkpDMFl+GOySd25nsQD2orsDiwJXHBanSyPuTSuMefpMzRPt+mh02V9uVtJR8zXAcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AtPPF13qpEftDM73qSHEAdWB/R5lNYkZ5qqDVD4PSUQ=; b=EBXszO7ZcPkPE5z8EYdAoG3Yhvk/L87XwVHWXThwpQ6RFGHw9Eicb89HxQMxBtj3uEEcXS3+r1BUUxF6VPxP4D2EogoEwIBAfraCYZR0+o3V2broBGCTLHC0D0bgrvbQ3OuRaLa7oj0isVr3j5TfeatKWy8akHwnNBwLoHAa/dY= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (20.177.196.158) by AM6PR05MB5460.eurprd05.prod.outlook.com (20.177.189.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.27; Thu, 30 Jan 2020 19:09:32 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::1888:dbf5:a84e:c53b]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::1888:dbf5:a84e:c53b%6]) with mapi id 15.20.2665.027; Thu, 30 Jan 2020 19:09:32 +0000 From: Ori Kam To: "Iremonger, Bernard" , "Lu, Wenzhuo" , "Wu, Jingjing" CC: "dev@dpdk.org" , "Yigit, Ferruh" , Slava Ovsiienko Thread-Topic: [PATCH] app/testpmd: fix copying the name of the dynflag Thread-Index: AQHV13BkGGtVvFp710yr96VJQvlP46gDbOmAgAAhYbCAAANf0A== Date: Thu, 30 Jan 2020 19:09:32 +0000 Message-ID: References: <1580390564-186435-1-git-send-email-orika@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [185.175.35.255] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 60bfa8e5-8d80-46a4-61b1-08d7a5b7f039 x-ms-traffictypediagnostic: AM6PR05MB5460:|AM6PR05MB5460: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-forefront-prvs: 02981BE340 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(376002)(136003)(366004)(39860400002)(199004)(189003)(76116006)(54906003)(8676002)(86362001)(9686003)(5660300002)(26005)(8936002)(81156014)(52536014)(81166006)(55016002)(186003)(2940100002)(66556008)(66446008)(64756008)(7696005)(66476007)(316002)(478600001)(66946007)(110136005)(2906002)(33656002)(4326008)(6506007)(107886003)(53546011)(71200400001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB5460; H:AM6PR05MB5176.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3/hhtsiyQ3GuKsc+WG2SxafHPAY+r2GXgtyZPFEkMSIPrrv62sDPxmUqWMFnQhQ8Zr+JxHTve8nako6S5Y8b/0+owWgoBvFQ3Cs9gCAO8ucVmTyF1tBgx7y3mNhrgK0q82qHVZJD2Bfk+p1hCQDEHhgtB19SXH/A26ehfZCwkCYCbqOSPsCn0LlV/IOSER51fQ2IBj6PK2tV7ddyqEVLI1soMs1zXE49lhGq1c0fKZ97Dtd/q+K0ygAwuvZq35BDoeQ6U21eW4O2C2weCIbFBtWJ1fqrVTpUvuY9Q3fYRhywm5A9FTS4NzD1E7Q43K12i70Rrw0p34tbCa5lhRu5zBvZ70VrQ2OfKYrg/jjVXgzSBR6VmqnqdOLgoIwHLodX1dEy/r0VJgvHMn3NRmA1jr98b58FSJKCdiG960LkFiRUuysBcxl2wYDjLn2A2yoe x-ms-exchange-antispam-messagedata: RfknDgGPvrP14XY54TpAZSJ2jh2s2S54CS6uvhyEpULGkxUQncIyCcaEdZOseFIfQQkj/6ZJcctzfbS+AIgyrjEX4ddIjJihlK5kaNfZvHvtQsiMuJ1z+mfoRcghG21zRbyj5GUQqso3TIeAl3sTTA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60bfa8e5-8d80-46a4-61b1-08d7a5b7f039 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2020 19:09:32.2596 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kkObA004SWYMR/VVXr0f+MHOJ0mje+ZPzShZZJ0U84pdK/c2q4o4zkA1mr7Bxo1xMksz/xq8slk3iaOcQKiVog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5460 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix copying the name of the dynflag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Bernard, > -----Original Message----- > From: Ori Kam > Sent: Thursday, January 30, 2020 8:56 PM > To: Iremonger, Bernard ; Lu, Wenzhuo > ; Wu, Jingjing > Cc: dev@dpdk.org; Yigit, Ferruh ; Slava Ovsiienko > > Subject: RE: [PATCH] app/testpmd: fix copying the name of the dynflag >=20 > Hi Bernard, >=20 > Thanks for review, PSB >=20 > Ori >=20 > > -----Original Message----- > > From: Iremonger, Bernard > > Sent: Thursday, January 30, 2020 6:54 PM > > To: Ori Kam ; Lu, Wenzhuo ; > > Wu, Jingjing > > Cc: dev@dpdk.org; Yigit, Ferruh ; Slava Ovsiien= ko > > > > Subject: RE: [PATCH] app/testpmd: fix copying the name of the dynflag > > > > Hi Ori, > > > > > -----Original Message----- > > > From: Ori Kam > > > Sent: Thursday, January 30, 2020 1:23 PM > > > To: Lu, Wenzhuo ; Wu, Jingjing > > > ; Iremonger, Bernard > > > > > > Cc: dev@dpdk.org; orika@mellanox.com; Yigit, Ferruh > > > ; viacheslavo@mellanox.com > > > Subject: [PATCH] app/testpmd: fix copying the name of the dynflag > > > > > > When working with testpmd and setting the dynflag name, we copy the > > > name given by the cmd to the dynflag name. > > > > > > The issue is that the size of the dynflag name is smaller then the st= ring used > > > by testpmd. > > > > > > This commit solves this issue by usign strncpy. > > > > > > Coverity issue: 353610 > > > > > > Fixes: b57b66a97ebf ("app/testpmd: support mbuf dynamic flag") > > > > > > Signed-off-by: Ori Kam > > > --- > > > app/test-pmd/cmdline.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > > dab22bc..09429f9 100644 > > > --- a/app/test-pmd/cmdline.c > > > +++ b/app/test-pmd/cmdline.c > > > @@ -18867,7 +18867,7 @@ struct cmd_config_tx_dynf_specific_result { > > > return; > > > flag =3D rte_mbuf_dynflag_lookup(res->name, NULL); > > > if (flag <=3D 0) { > > > - strcpy(desc_flag.name, res->name); > > > + strncpy(desc_flag.name, res->name, > > > sizeof(*desc_flag.name)); > > > > This does not look correct to me. > > Should it be sizeof(desc_flag.name[RTE_MBUF_DYN_NAMESIZE])); > > >=20 > You are correct, I will send a new version. >=20 I wasn't clear I will fix the code but the fix is not like you suggested. Your fix also doesn't work the return size will be 1. The solution is sizeof(desc_flag.name) > > > desc_flag.flags =3D 0; > > > flag =3D rte_mbuf_dynflag_register(&desc_flag); > > > if (flag < 0) { > > > -- > > > 1.8.3.1 > > > > Regards, > > > > Bernard.