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 8BD42A0C4C; Tue, 5 Oct 2021 16:45:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 75A77413AF; Tue, 5 Oct 2021 16:45:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 6CFBB4137D for ; Tue, 5 Oct 2021 16:45:48 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 195DvcPr002997; Tue, 5 Oct 2021 07:45:47 -0700 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by mx0b-0016f401.pphosted.com with ESMTP id 3bgr1qg6jh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 Oct 2021 07:45:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gPZJ2214oScsDs7KhuYXo13IWdTyzyyBLdcmfjwHcb608Y1H0KHbZ4DE+Sh5rtwtPsDK8oI6HxQ3DrxNFUx6E+r3cASWScDE5WNE08M1utbyLXB15P1iW+aqH/i+CDjJ+j3skj2d/5sRfMGt2dw+wBW4O0bBlpLKbh5SIo3o1iMw4y98aQD22sIiU9s8L/P+o51rwN+ZddJ4gmRu+rZDsiWAWCYQ+YYB1IW2HDzXYqIfDg+Jxm17Mh5xslbYMVMuv8f9kt+MnVkKfTuviSP6dj0NhCwEH6QPCYaWkf88YAJwpOwW91TskOCnUhhjkIfpZRz5FwKrSTbbIx8xDxMI1A== 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=TOBJpISJNduhJj6Bi9BSsNLeRi6C6Txemybk/gUwmYM=; b=Q1tSzuqC2A617YGtcaC44XLsbIiu8yQOto4RRSSP1vrgqrtsNBfqZy7ldgY3CrsH8jpE/C9MGhU/Xo3G1QG0SyL8MiPPHkJwRLQTfPsU39ZXG3FJGC4jdQCBcjFRgVM8jKXmcakE80tzN70wZHJJHclQ36R4X5LwEyiWwo6isGkx+91zdwA/DGKV1TvBKih5r3pG+zTawDb9Ju4EXFDYVfjpJ7K8uSJR0mJO8Jm8ERFd0wgXroefUgKWVdsgv/dadnpDwmb5Ju+NIoSfIW7YKaGFkAIGmTfdX8OuklzcMZ/M6J1xr2u4cBcEz1Xwlr0Xn3CXSpbCwohIoAu8cvugpg== 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.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TOBJpISJNduhJj6Bi9BSsNLeRi6C6Txemybk/gUwmYM=; b=lsD6ESaoqV2+mH5ZeOw+X4Q1FqjU3kUn3Rul/e6KqZ3IUAUKB7dwdw22VOskM12y2BWLULq8hOfAEQVGaK4JoT5Qy3xiAz4JInWT5XCF8P5Yuy8xHIePHw3SwxKw1epwGIAFZ4qK9ROIHy2DEN/yluDFaNRF3ZlWYGFDvscnKwg= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4572.namprd18.prod.outlook.com (2603:10b6:303:ff::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Tue, 5 Oct 2021 14:45:46 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8%6]) with mapi id 15.20.4566.022; Tue, 5 Oct 2021 14:45:45 +0000 From: Akhil Goyal To: Przemyslaw Zegan , "dev@dpdk.org" CC: "roy.fan.zhang@intel.com" , "pablo.de.lara.guarch@intel.com" Thread-Topic: [EXT] [dpdk-dev v2] app: fix buffer overrun Thread-Index: AQHXr5q/Z6pnEk0i7EGR2cn2SlzpVqvEj2KQ Date: Tue, 5 Oct 2021 14:45:45 +0000 Message-ID: References: <20210921132125.6109-1-przemyslawx.zegan@intel.com> <20210922101511.10395-1-przemyslawx.zegan@intel.com> In-Reply-To: <20210922101511.10395-1-przemyslawx.zegan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8a3303a6-34ec-427d-8caf-08d9880ed07f x-ms-traffictypediagnostic: CO1PR18MB4572: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I+t/YnNRzam09zGUQR03X46IQH3xmEatfC+fEuE1r4HbbV9aXg8H2+2xYPhmRK8+2+lr5QrL/IDZlxYDHlSnDgunHYM53j1/7N85EuZ5a+KyhDtEZC4Vzc8uP2ZJdOrkx3YGix9PcQRyPRRQGZj5dHMAU4nLcoULmvAbxMMqCZjZJ71O8ks4S6fK7GcLbMBygR7i3hhGR79jtrvfyhguA3W6WXDxgLAc3lew3cNbXEzNok5b/o3VzTgaCqyhU04wFuPZpG60F8Wfb6zaKKUbSNVjULF2WRGCSEWi8QnyBrTuHy9Ckr3hvkxEPTI4DA0YZKY0jb0koXxbEtuDbsVUPwC5e1t56IN+kkVq4uUKxkL9Yqy31p7nhp40XPT2ukJKOHnsi2PfOPffmNJnsW2uLqgx44ZDNzctbbXkNADCQGx3YFVd2/eUVNGbEKAKw8Rq9WcafwwzAavUa+ibA/4/JHBhlhu8rwxl2dUx0Xsq0Fz0ydZbGonIjMmoZSXd0QoaSLHDrSbTOOAj7+9zygZXa0+wBxf1pEZxjYnoAU/z1PWRRsAP7Caa3gCqc5EnPKl7KiVxzGNUi3b0n2X+woD49dKlscejWcZRz7xPx94/bsNQ9YaXBscbYo8nFcjaZ9ljg8rZIYvsjJV4C7itCnWWD/oB8NOa/mM8slNIVk7nsKw4gx6sflVJR9Pq1dAZg55+WOXLZ82WAhGAZQ0Tt2iqKA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016002)(38100700002)(66946007)(122000001)(38070700005)(9686003)(5660300002)(83380400001)(33656002)(2906002)(8936002)(508600001)(66476007)(66446008)(7696005)(64756008)(66556008)(26005)(6506007)(54906003)(186003)(316002)(86362001)(55236004)(4326008)(76116006)(8676002)(71200400001)(110136005)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HI7cYbms8bYPcCGSedWvmRFls1hIkubIVdr1bYCqCCVEp4mlElDdhXIy4agl?= =?us-ascii?Q?wehRBSPDkmyXg5zUt39bHUL8Lql9CyGnlzAYljfmeUyIgo2BTo0TKxCtuKhq?= =?us-ascii?Q?Elg4WckdxtSd5JKDYHXIvPX+IRNVc0A88A0cUPX/BEwfduV+gXVXXu0koRve?= =?us-ascii?Q?lfzmogz1CwK2im/ewifT9WdNgyqXAwVfW0gLEzVEBUeJL026OCDvmlNoIX+e?= =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Gwkb3m4yNiLxYUUAecRIM?= =?us-ascii?Q?sCPQVh6sfM4MwJL8KYRPw18JcJbeD2zMVsjGY6/aMgVT54MMPswC6dTNEUsA?= =?us-ascii?Q?WyqJCmiTOBgvQA9RJWhsG5SkDsRbeu/OHzu6GrtkCHVP5tXY4a5P7hZQ/AB0?= =?us-ascii?Q?4QpKBi1cfij7raq6HNTS3BDUGo2DdzWdAgoRMrd8PnC8pdNxhyqD8f1GZXoV?= =?us-ascii?Q?qh0dckQuWB2+1TAcIB96nbw6?= x-ms-exchange-transport-forked: True 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: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3303a6-34ec-427d-8caf-08d9880ed07f X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2021 14:45:45.5847 (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: rgdF69lZI2KT1trzZOvxe/xIk6Bbvk5m8QnG1YyC2KLwPlyEfeXg65wv3hRtQizy0v+i2aAh/RP9L9IoX3Rvbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4572 X-Proofpoint-ORIG-GUID: GC6sj4gojwL_zB8hyl-J35aIDFDUYho7 X-Proofpoint-GUID: GC6sj4gojwL_zB8hyl-J35aIDFDUYho7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-05_02,2021-10-04_01,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [dpdk-dev v2] app: fix buffer overrun 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 Sender: "dev" > This patch fixes a possible buffer overrun problem in crypto perf test. > Previously when user configured aad size is over 12 bytes the copy of > template aad will cause a buffer overrun. > The problem is fixed by only copy up to 12 bytes of aad template. >=20 > Fixes: 8a5b494a7f99 ("app/test-crypto-perf: add AEAD parameters") > Cc: pablo.de.lara.guarch@intel.com >=20 > Signed-off-by: Przemyslaw Zegan > --- > v2: > - changed to correct fixed line. >=20 > app/test-crypto-perf/cperf_test_vectors.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto- > perf/cperf_test_vectors.c > index 0af01ff911..2c7e314ec8 100644 > --- a/app/test-crypto-perf/cperf_test_vectors.c > +++ b/app/test-crypto-perf/cperf_test_vectors.c > @@ -548,12 +548,16 @@ cperf_test_vector_get_dummy(struct > cperf_options *options) > t_vec->aead_key.data =3D aead_key; >=20 > if (options->aead_aad_sz) { > - t_vec->aad.data =3D rte_malloc(NULL, > + t_vec->aad.data =3D rte_zmalloc(NULL, > options->aead_aad_sz, 16); > if (t_vec->aad.data =3D=3D NULL) { > rte_free(t_vec); > return NULL; > } > + > + if(options->aead_aad_sz > 12) > + options->aead_aad_sz =3D 12; Instead of hardcoding, shouldn't this be sizeof(aad) > + > memcpy(t_vec->aad.data, aad, options- > >aead_aad_sz); > t_vec->aad.phys_addr =3D rte_malloc_virt2iova(t_vec- > >aad.data); > t_vec->aad.length =3D options->aead_aad_sz; > -- > 2.17.1 >=20 > -------------------------------------------------------------- > Intel Research and Development Ireland Limited > Registered in Ireland > Registered Office: Collinstown Industrial Park, Leixlip, County Kildare > Registered Number: 308263 >=20 >=20 > This e-mail and any attachments may contain confidential material for the > sole > use of the intended recipient(s). Any review or distribution by others is > strictly prohibited. If you are not the intended recipient, please contac= t the > sender and delete all copies.