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 046ADA034E; Mon, 21 Feb 2022 11:38:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79C924068C; Mon, 21 Feb 2022 11:38:21 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 6D3D24013F for ; Mon, 21 Feb 2022 11:38:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645439899; x=1676975899; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=50CTLBK0IltJYAVH/4UXE8vTbUnFSD/BmTVF5BVogaI=; b=Gf/bBNV9IS7p44JxLS872lT425VuE1dktC3xrmQW8p8EuSfYVSdUguEL HRWVvmcpabr8a9KVf9pgRG21oOExc4+P7X7Dn/Rirx83UNVyryrlOyGS0 lNYxyJyCxJBXvtI8CuPOOBSaYidRk3DdOjy5RCnZASbLIE/A5ajZwNpcG SuIIjYEnl9IvKaP7H83RvwzwPWDhbqIIQ2xTJtd32q0fa2RUUSAM5nWzR 4IJc1OckSIBK9bBHb+d/DFTf3Ve0RwcPMvfmSDZIkBz40cFOA+I27WnPX J89fHZ36GkeVc79YX6KNB3y6IoFyBjXtCYg8xCFaGhNnwsXZwEhRJEm+9 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="235024236" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="235024236" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 02:38:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="531809918" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga007.jf.intel.com with ESMTP; 21 Feb 2022 02:38:06 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 21 Feb 2022 02:38:06 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 21 Feb 2022 02:38:06 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 21 Feb 2022 02:38:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fW1Kxy6evcroJhEWuuHNTaMlVo+fgyvmO+kxjFjLhoHr9kMnTO2a4buMEm1aXjZHSWzhcLQO0KlBrrsaxVkjsO5VxV15EDQgLXkr6P9h9js5UKSzEDRAvGahsx6fEphyBVVm4QMMiRSLgxSiVub/nvmdMKdtL3mTlon7454BZPNYAa62m9kHtuoTuU+3b0nk8d92f0ohggzSuPvL34d1VfQf/Ra7B5GjuVA/4kAj1QqJ2LW6y+95vKLnSUzNaVmiO7xv87X6VxpG1KQGpF+6516C15RvDlCaf+RgqMuVQO/v9QKxZLV6+Kmdvj4L1K1zTHsBp57bfQ9kbLCbimqdbA== 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=H/gonFzgg2pIjeU7VXtVc6SsssPzy3Pp0vh5Jmf0j7A=; b=f9/AuwCM7b0ma0ukCwTTjlXZO6J+ufe2GnADXAxA5l/a86+djBoLiye33vsIMO1wKK0/ftevvF0/qrz83TfqF8Td4LuhsgE4v9AHjKVdKyo8GsDFhTWU5KYiR8tukq8+GUlAmxpuidBIafslms9Q8wJdJhFffFDH7d53wRhRtkbkF2PzqJstcJOo5F+Mw9uNeQxw4XdVhq4Gtl+10uzRDzc4gczwFfLYfAt7d5LK3eShpHS0GwHZWAWEzC3MP/Ky05cDegWQVhYBxUtQL/ZAuOYUsUxjw5UG4mGtCIQqlcnhJNqyfbFzVpEXIsQ0xHSgZ18hX8+zNuo0C4W7qJbeCw== 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 Received: from PH0PR11MB5013.namprd11.prod.outlook.com (2603:10b6:510:30::21) by SA1PR11MB5804.namprd11.prod.outlook.com (2603:10b6:806:237::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Mon, 21 Feb 2022 10:38:04 +0000 Received: from PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::501c:25d4:c916:7602]) by PH0PR11MB5013.namprd11.prod.outlook.com ([fe80::501c:25d4:c916:7602%4]) with mapi id 15.20.4995.027; Mon, 21 Feb 2022 10:38:04 +0000 From: "Kusztal, ArkadiuszX" To: "Zhang, Roy Fan" , "Power, Ciara" , "dev@dpdk.org" CC: "gakhil@marvell.com" Subject: RE: [PATCH] crypto: fix asymmetric private session variable size Thread-Topic: [PATCH] crypto: fix asymmetric private session variable size Thread-Index: AQHYJMcrZ8rKzMkPa0+Uy8aDo8GcBqyZWGWAgAR8GVA= Date: Mon, 21 Feb 2022 10:38:04 +0000 Message-ID: References: <20220218125752.579335-1-ciara.power@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bd5be61e-ccdd-4d78-0a15-08d9f5263dd0 x-ms-traffictypediagnostic: SA1PR11MB5804:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 45pgnOndOR57+C1nRSoI1isMofzSpzT+XPZvhju5jb3PddMB+xlbTom8FBwWnfnWB8DA8z/5ojB3agkMhQjrPRDc/EKVmybEuoeT2dTXDSPlXA1zAwlrPmrxQRDxjxJ71qjzL8z/g9K9fIbWl/cFY2EXg6/pMeMk99V9H1v9sXKUwSrFY7XY4eRJadmRqbLwlQ5wFUDPs8UpAwXxYZg7iZvreFFfKgIc3upDi3oYHT8kANcgYPdWrceLbqM8V4wypuVsWNGxoIdCXLqe7l1B4OkytINuHgc57xNQVZvU+Fv0r1VGYCvV1INmB1WTmA4vQvZzKdJ1g4m3ut0OmyZ3L5tLrXg+B0FZRXdxPvagl4YhQhCJs8yKd3Qe7vE7tiiZZGZRpJV+/4NpJVmWwgRPSYQ/xNwdRLVFzwraTZKsrMbrDxLxU/nDn45otw9/xVsdF+77o2YQ5jfv7hnE7k9Brz8VGMqUy1UaYrAqcMaTrZgWPbm1237rXQp+2ykYle0H5GHYAA6b8zcxP1dGLjdQYMX/O+/e9SnQe9C5fqB01Hm4IsrM54zV06IuWXvFeKoT2R2NYfcgDJLyaX6twII1HhtbvS7H8w/3n5dbdwdvPJfbjTnXB/O9NDBTK5jCxlMIxR0M7WnTXjf8roMLz+M+fEgMYLkgG3w21a2hooARvIsCen34J8Kdaj4kOH602jhgyjCCLZ1WkrtcW37DIja8Ew== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5013.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(2906002)(55016003)(82960400001)(38100700002)(86362001)(38070700005)(122000001)(53546011)(508600001)(76116006)(66556008)(66476007)(66446008)(316002)(7696005)(6506007)(9686003)(66946007)(5660300002)(4326008)(64756008)(110136005)(8676002)(52536014)(8936002)(33656002)(71200400001)(26005)(83380400001)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iImWJBoV2QN0H+8lj+ZEji1VN1ozoUAKnzs8Rl+ZKOdaMnVyGSTnCL4iSA/b?= =?us-ascii?Q?2SxD2rPQlyD6eoc7GmhIN5WhHD7hfBptUOVCNL+pj+J3OJWhO+eyPZwE7lLF?= =?us-ascii?Q?+7AoM1XRSxMK1hM/z+GRpze69GmqXjUzjkE+6GlHVJjyCTBa+dPnvdsPAl2S?= =?us-ascii?Q?Uh6/WoatUxMQbDZogAXwMJx0TNVsdB+5tyLsu82w4p6UdR0zp7h1fFs6G2Pt?= =?us-ascii?Q?BQ+IzWpjLi1shrLigg7Mh4lJl55vqW3Qpd2ABHs+KJ4shQ/vfUrs4Iilda9Z?= =?us-ascii?Q?Bd/bfC73g5vNd3AFkY3tDErr0MQ9i3ujs36J/nBRI/vmYYpRyCEn66aBp2FP?= =?us-ascii?Q?aHiDdo+i+Xr6qOCrycsBWFpAvDaqSFIkTzcxzOMOPGhr733pLt998jXbd5NE?= =?us-ascii?Q?V7B2p9uawky/ZiNDcxA9+o0dCbGooDXjlWim2R5ZU6GPl6pndTzYImxTKFDU?= =?us-ascii?Q?ofr16KofEE6qqupfWY19j/ycTr682egcUEnfkRBOU5VRyT7j/4GzcUbY7+lU?= =?us-ascii?Q?6GR+BoWy2d9dUNI9tLjZ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-ascii?Q?jAOFWXpc3RDAnuIy6n62phgM8WK77xoo0bpmdXb1N2ECBagrorzKhWga8bam?= =?us-ascii?Q?KUpovGRFFe4thCuqbQmY27BJCl2z+ixSbP4wlKTOt9VjUBvIZOxZtUf5QBuY?= =?us-ascii?Q?CLNyCgcevUEv/Go/hFuDaokAvmcLRd8JsFYpQTQNAnRszHqfYnzcTbXS4z/7?= =?us-ascii?Q?tFzkC5qA9QZg3fgc5UoYZqiqFfC85fFMHLyctvn33PezUbfN3Rw6S43tLrqL?= =?us-ascii?Q?QnmpuA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5013.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd5be61e-ccdd-4d78-0a15-08d9f5263dd0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2022 10:38:04.3773 (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: odepltKGK3b997IT05G4TLKWNc2/Ncodx7X++ZicZ8bWxTns7paXSO/S60PhJTmIJZDRDz5GOzB5PvNdqwkozsRv9eSAdWin5fAyOMmH/eE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB5804 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 > -----Original Message----- > From: Zhang, Roy Fan > Sent: Friday, February 18, 2022 3:08 PM > To: Power, Ciara ; dev@dpdk.org > Cc: gakhil@marvell.com; Kusztal, ArkadiuszX > Subject: RE: [PATCH] crypto: fix asymmetric private session variable size >=20 > > -----Original Message----- > > From: Power, Ciara > > Sent: Friday, February 18, 2022 12:58 PM > > To: dev@dpdk.org > > Cc: Zhang, Roy Fan ; gakhil@marvell.com; > > Kusztal, ArkadiuszX ; Power, Ciara > > > > Subject: [PATCH] crypto: fix asymmetric private session variable size > > > > When creating the asymmetric session mempool, the maximum private > > session size of all devices is used when creating the mempool object > > size. > > The return value for ``rte_cryptodev_asym_get_private_session_size`` > > is unsigned int, whereas the variable was uint8_t, leading to a > > possible overflow issue. > > > > To fix this, the variable for private session size is now changed to > > unsigned int to match the function return type. > > > > Fixes: 1f1e4b7cbaad ("cryptodev: use single mempool for asymmetric > > session") > > Reported-by: Arek Kusztal > > > > Signed-off-by: Ciara Power > > --- > > lib/cryptodev/rte_cryptodev.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/lib/cryptodev/rte_cryptodev.c > > b/lib/cryptodev/rte_cryptodev.c index 727d271fb9..d262ae6ffa 100644 > > --- a/lib/cryptodev/rte_cryptodev.c > > +++ b/lib/cryptodev/rte_cryptodev.c > > @@ -1810,7 +1810,8 @@ rte_cryptodev_asym_session_pool_create(const > > char *name, uint32_t nb_elts, > > struct rte_mempool *mp; > > struct rte_cryptodev_asym_session_pool_private_data *pool_priv; > > uint32_t obj_sz, obj_sz_aligned; > > - uint8_t dev_id, priv_sz, max_priv_sz =3D 0; > > + uint8_t dev_id; > > + unsigned int priv_sz, max_priv_sz =3D 0; > > > > for (dev_id =3D 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++) > > if (rte_cryptodev_is_valid_dev(dev_id)) { > > -- > > 2.25.1 > Looks like the variable type of unsigned int is match the return type. So > Acked-by: Fan Zhang Acked-by: Arek Kusztal