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 DFC82A0032; Fri, 18 Feb 2022 14:39:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEC604068B; Fri, 18 Feb 2022 14:39:23 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C9DDE40141 for ; Fri, 18 Feb 2022 14:39:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645191561; x=1676727561; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+nfpQMuLjyKFwRAeoVCwFDRNCWT9Gr+LOPyeUrtMoFc=; b=k24ZfQsCpIv9RtFy8wJ4ncgH0tzMJ1/zwVG8ZEDseuEe671dCY0cGB1v voUNop4zbjop8Uv0vQT59VugRcm0suLPJsJ8Q0fxgvHkyQKP2wyjwjMTQ 44FaX7GFRlsHith0z58fHN/KE5FbsLw/MPt6ZyVjJ/X/Sv+6ByNv6XqNw s1j00yBrsEOHQf/diwy2YDc+wy5dWDetoU/8Ycg3bv6uXO4u/XhgB6nh8 jenyQPk+EerlYRwClhlQKmOSpjxtuZBjv6TgrT8XdeOykRgOFTKl2W0Jz akuphJR31wFZ9uw/KyrCBBMmc2XsMMgNBHW3wuv9dNAyHNzzflYbMgsEe w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="231762449" X-IronPort-AV: E=Sophos;i="5.88,378,1635231600"; d="scan'208";a="231762449" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 05:39:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,378,1635231600"; d="scan'208";a="705387183" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 18 Feb 2022 05:39:20 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 18 Feb 2022 05:39:19 -0800 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 18 Feb 2022 05:39:19 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 18 Feb 2022 05:39:19 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Fri, 18 Feb 2022 05:39:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pxvp6JrZH8t7AtqXXzN3CfQb32YEFBLKyoh7nWNnsUism4zWTXVPQZ9tmJeusFR3hjlNT4vQhBXYLciz/Xz5X+VnGWh0RQrPNnHd/hqdM7frz0ueWbdCA93fXF/tZmp86JBM/VGdTXvoMXHAbWv7RhDJCUNHsSARDY6dSLatvM5Owh8zM+xQJMks7Z43GTeLTmvTFDrd5TrToF4jW4ni22RPxKZIBRjXTlvUlN96ELCNIdFfrWb1if006vENYoyJJN3+l1TcbNy7Mv2r9bBiesfHNq8demNRB+X73Yv6+8SdWn1qTgIJ5z+/0vHMSz/POV1lbZaaIHCd+EtEnTgJ2w== 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=zxKPY9AA3WaE3q2i91waJ5LlbFqUFdN+y1pxzlS7DD4=; b=UsEg9CWsfnbBHAwI91whotpWJm9rT0TONSCk+RP3ZzbQ8gj0KKWzgumuOPhtGES5SmXuwc4Mern8q0yLc36HNbg+mLDCUJnw1zuZ7bJZf5E9wXtGt12bS6e6ZtQP8xSwmgkMWpiVW5ZnZ6nrwouEAy/fHfGwo95j3nVvkjjgkoFrJ5swbEFd4kqiZNyfySvX+jjzQjgtdYGSLtR6jA01fYo3lR6Ij6rcpy1WU6uN4MmnANF/6df9d3JeHMo/M7Wo1saSzDvTpJyWMTmilaGNqZRv1o/U7wq0D1ffX3s0AKRG3XgTMwW96yepVZ5EAd1NQIAYAcGDObrl2a2VdNhfww== 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 MW5PR11MB5809.namprd11.prod.outlook.com (2603:10b6:303:197::6) by BN6PR11MB4068.namprd11.prod.outlook.com (2603:10b6:405:7c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.17; Fri, 18 Feb 2022 13:39:17 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::a599:b969:5072:71cb]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::a599:b969:5072:71cb%6]) with mapi id 15.20.4995.016; Fri, 18 Feb 2022 13:39:17 +0000 From: "Zhang, Roy Fan" To: "Power, Ciara" , "dev@dpdk.org" CC: "gakhil@marvell.com" , "Kusztal, ArkadiuszX" Subject: RE: [PATCH] crypto: fix asymmetric private session variable size Thread-Topic: [PATCH] crypto: fix asymmetric private session variable size Thread-Index: AQHYJMcrg9DU95HrKUi5XVhXLm1aKKyZT9Vw Date: Fri, 18 Feb 2022 13:39:17 +0000 Message-ID: References: <20220218125752.579335-1-ciara.power@intel.com> In-Reply-To: <20220218125752.579335-1-ciara.power@intel.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action 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: 2c9703dc-0675-4cb7-40e3-08d9f2e40f6d x-ms-traffictypediagnostic: BN6PR11MB4068:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 86dPapp1b0ZPik615xgTvgvGWP6VC5udTTNA4AvgiDMI9GJjACVgUpnY6a4ZWRIXZKe74Ecn7I0JQzyd/VK6WtsUevqiDq47J5ZGZIECY1L0x0Aq2jxOaJznLnYHbnuI10BaoEsMqwYIv9zz8A3kZMtBLp0hqpwHnsqQkMRQIOsR08AN55LD5mBZ+PSQMcIz02TEmDkQKYNZEr3sUDKfTqMxxg9KuNxq8SrBclwA+nXsiD08RBi6WN0U8pAABVtvpUgRUQbHxy3oHCBNabhjgzCQ8/nGz59eDTupGppTM8GCW0WemOmiz6iveC+EXaGtzwi0qR8wenSaT9+faYv/CNc+xHIlpQbxjkFckDfOJVLGqjMzU/yxsZGB7TBCiwxYNypIvVNLo5NdoJAVuZRsby3qOcUv5/ombj8v3AHe5E/dSCKORze3KSGC9/A2J7t1//tzT8AG/L1Lzajh2yO+ukLq7oxvoN8Ql23myjURRrPth3ssJV1Pp3unRgl5Ldnz+SXPJAgqSjChiRKhwksRD1r/4dT/uPp0tTvxoUlFDsqcdNPYFsOFNOalVxpe96s1PHuQ7ufTftBtTmnxBIYwAuWQiob0LGl70X9+RXgcGLIoA74F3idWyeEoqlGKeMBo5uJfgrbjM/WPHCuLwknxb7NP3U0SGBVhwgT1xpS2DPFT+y5PmhITEvlJKrRJ5b+RA7G382QWaXeXc9eqD/rk/g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR11MB5809.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(107886003)(83380400001)(186003)(26005)(8676002)(33656002)(8936002)(9686003)(86362001)(71200400001)(2906002)(55016003)(508600001)(7696005)(6506007)(53546011)(82960400001)(66476007)(66556008)(38100700002)(76116006)(66946007)(122000001)(66446008)(5660300002)(64756008)(54906003)(316002)(110136005)(52536014)(38070700005)(4326008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?II9zIkaDrCyK3HHaWYWX0xpRIa9WBZV3vxGukRoRVVXpHSrWCa3Mg3Ph?= =?Windows-1252?Q?uJNkwQX4tRVeFLY22P26iwcwFEs5P1j5s93KNAHpjj91Z0pWiKul/MVl?= =?Windows-1252?Q?uqFSS3TpeU1teDgT34uBNlWTgqYFl195fys8o2NohZc0CkUuGN5TAACA?= =?Windows-1252?Q?tnBLBaeMz9ZC25bd1s7e0Pu4+Fm2b3uwJ6g7saXxZIA7rdwkl+nROIm0?= =?Windows-1252?Q?N9YevUxHzFfSIvLQH9p2FXdpfLp9rhQNiOPfMjgmXIHL5Oa3HiffF5wm?= =?Windows-1252?Q?x1SkmcT+nqcQwoBn83wR7XbEt81e+iyiZr3K01pthv+DGuMYXccYv2UP?= =?Windows-1252?Q?c/4bCnRcYtOq//XyopMgimVH81WO059C4/OWDMIjtcviDu93Si+eL8ca?= =?Windows-1252?Q?diMiSdFWlX2AWMDYmi7sS408lCsGOnj5MQaTUUVfT3NNmTjAvNSf3g1D?= =?Windows-1252?Q?YtcR6L1FKrBVSTJ/dbhHuMqQyYW0dANnqpt5lC4dFay+W4zTzFv2QOop?= =?Windows-1252?Q?2R5JXEuiMeERqlEK1K2+qvq5xIwnlx3h3wdRHDi0Kd7K2Yqno1/DhPI7?= =?Windows-1252?Q?l3ugqT8y7hgwzQQR3lRBg41LekAjaCuAtDH7DATWRii/eLWBOrDWdP3H?= =?Windows-1252?Q?QyJeYZFAfYrDgv5o4+MFLWRROhrcnFEoUHZLhtzkWYTGt8KDTHwRjuMp?= =?Windows-1252?Q?EJgAwNTRFZ+Syi8OpiL6TzmmZl8OwxjcSmyjHSU3/W6mppuEIbODsPPZ?= =?Windows-1252?Q?7wA6sNiOqQyuZT+I7hCfAqnXB6bIcIA+3ifdFOJC2nXVfaBuUd0t4yJe?= =?Windows-1252?Q?ebfnT1Ml8SnNeiYUvu7/QNsRrP+Iggj0uu8fUsFfp5ttPpSYfCwvXMBn?= =?Windows-1252?Q?fyedOhWr2EdLHdeils6PzAvY/3RPzq9M/iJI5DM8uA3GSzQgwOSQxBEY?= =?Windows-1252?Q?uCtB9vJM1ZghuVOU1rOsGxHmtTXEXD8a+HVW3nmYLVCyNHFkT8qujSxj?= =?Windows-1252?Q?QlSlozWTXZk9YK/IPRJ6Gc5d81nXEilyjaS8+tFILnVf10giFXVQdXxo?= =?Windows-1252?Q?sRU1xkvy5QDcDmy1MnY1gdmURLkVTORIEBs9FH5ShEGEMpCZcyLWN0Kb?= =?Windows-1252?Q?q0tz0U4IjOhikmTyZM2c4egGCUvJA4USNjv57Ha8IJQd3chaxadMZ2dw?= =?Windows-1252?Q?Z6iYdZGPr7njxW5zDZi636wWRbY6FeKLk/7H9sUSKdO2lj3mKlE1q2jx?= =?Windows-1252?Q?/HbNgEL87kZgDLtfH8J9ERsbhieea5PxqTwnubeChkR7PyQiHeGImA6X?= =?Windows-1252?Q?gP/JGKVBy7gsC+wUhbReLLofqCHmo6TjzXFCk+hdQc92+G0N9SX9/lo/?= =?Windows-1252?Q?hzssxj68LYQfyrxohDxk9wKb3A1B4oBJZAH/Vbk2tq+VCpqpH/hyYz7H?= =?Windows-1252?Q?cpSnJlY6l6Qdr8sWYDOd5INnSv9SEW83wUlTS4Stp/DK6QZVo272F7bq?= =?Windows-1252?Q?HcmlicoNG0y8mhcV2z3mzZn7KvQlZhdeZNwlFaFM03WQuLe5b3VwqHXM?= =?Windows-1252?Q?EWp5ks7ggA23E61DD1oHRWpb6gs9d1bomVzsxKDXI/LJSMpXRk6dfWnT?= =?Windows-1252?Q?jz7tLWHEK0Twadao9b1T992X0kOgrsAjtwGiNPDtkkQgy0z2yu9OSQGA?= =?Windows-1252?Q?RFHBK4/jPeeyLlpaBnl8EdYj0XX8nyDMLvbAnRNSIjKyDkmMB3K6Sw?= =?Windows-1252?Q?=3D=3D?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5809.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c9703dc-0675-4cb7-40e3-08d9f2e40f6d X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2022 13:39:17.4294 (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: AklqBhd9XCv3DcCkiS+sBJMqEOEBrTAgR/JHYQCVKJcbYbZ97sVaeeCXUndamDVsAZWKiPxsWRYVvXgtOpuSNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4068 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 Hi Ciara, > -----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 >=20 > 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. >=20 > To fix this, the variable for private session size is now changed to > unsigned int to match the function return type. >=20 > Fixes: 1f1e4b7cbaad ("cryptodev: use single mempool for asymmetric > session") > Reported-by: Arek Kusztal >=20 > Signed-off-by: Ciara Power > --- > lib/cryptodev/rte_cryptodev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > 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; I guess it is better to use uint32_t instead of unsigned int? I know they a= re most likely the same thing but probably better to use consistent type. >=20 > for (dev_id =3D 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++) > if (rte_cryptodev_is_valid_dev(dev_id)) { > -- > 2.25.1 Regards, Fan