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 57AF1A0032; Fri, 18 Feb 2022 15:08:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC2764014E; Fri, 18 Feb 2022 15:08:22 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id B758940141 for ; Fri, 18 Feb 2022 15:08: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=1645193301; x=1676729301; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=P4XzgcV1fmEgepNySAppvLRqnQS1P+I309G7Aet/OU0=; b=Mfm0lJBcoXopMPPiaya5wSp5+bVBGtqZjTCEqGTZpoBJ13+ahTHxNVYb ar3Q8HPOK45FDFR0hpRZc2ROiEo9jgrCEzuSGckT/1x95oPcBWGeHmEF4 z0AOef2UkMWSpCAd+7BYU5rMbGZuAVFP1uB7ybhKyCw6TUwx091dufepW 4GuOx4DrHkDEDf0mEpxqSuY0+T12Tood23n05Z5V/CLTsDeaY8fP3vTfp Dibe+jqu4p6VhR9tbapTDP+p+BW0eHplJOG+t4glLgCaSRCoYO67p0vPP XqSRYScrwIr1S9cf2HbaTHe0weRzewZabB/JIdWfdC+Ze5V2fw8am34rZ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="238534972" X-IronPort-AV: E=Sophos;i="5.88,378,1635231600"; d="scan'208";a="238534972" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2022 06:08:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,378,1635231600"; d="scan'208";a="682520247" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga001.fm.intel.com with ESMTP; 18 Feb 2022 06:08:20 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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 06:08:20 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) 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 06:08:20 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) 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 06:08:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H0YR+DyPxYUiL1l8Lg1nh2oRzRFf/uiayQhEyUC9EaaZeQzYLxM+NpfB6LlroaUpTnpbQGFk4Qwc1GXZL/SaUjXXVi+6g7XSENOcnlNA8PZufu7+On4zoLYFA9QLf5X9K5bowsrxLLDDHfwLW3PcPoOMWmMqrMOwswqUtPVlDPPN9vf8DXXiTq9Schb4xgDkxIYCJh8GHKLckLkvN0qbxMrNDX8Pp3M7N2FFz17+FeSg7dvEOh0kjFk6H9TgiRmd2tzNmXtPnZ+mqtGClGQKkIW9dOqNEAVk8gZLHloXzV/dCc2z9CLiaWxUtfJgcVNDdtliTotgFg3Ju+P3xXUxDA== 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=oxbt2jzlbic1T6JGsc7y3pvjsVi9LAOeOdcLaV28hXs=; b=Lf1/b+XUJX6BoYyeAgZYEwuOPrxoy52FurjSkdPEqYcDgMVJN/kRCgo6ZzYOv6mZMSN3GXLyFheFYMOisblnBoDabUeKPUOgND9i3MDFB8vZiwLHElO4ErGDxzs+fCQIi9Pq8FHxxsCj8C3FJ1FfRdLy/Du5Ir9Psn8b5dAyDnYRxc1U/a4g6F+spahk1KRxkHl4Fi3UpMezp9NGyzkVC+pOeLSqe4hscGd6KOaaM+s770/ukFD5Uy2UZCPzHZHvdM+D0wHsm3cjWnkCcmpvwtwp3BSjCDd7w85VbgNyThV2HvMYU9UfBguHelBOy2IV0qrlmXRGnTmd0qShAylVcA== 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 MN2PR11MB4445.namprd11.prod.outlook.com (2603:10b6:208:18a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Fri, 18 Feb 2022 14:08:18 +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 14:08:18 +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: AQHYJMcrg9DU95HrKUi5XVhXLm1aKKyZWCnQ Date: Fri, 18 Feb 2022 14:08: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: a7f3fa07-fa16-4a3e-e6fa-08d9f2e81cdb x-ms-traffictypediagnostic: MN2PR11MB4445:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MDqJznIDTZfdsTUrCDHk50RfVuiOzKxBNclNiE9TkjVEiBfW5Sryy21UDGEJN+JFnvviHxJ6Iy4ZAsoOjsS4owKi5umwm8m/+0zIHUpWWlIlptD+obof+9ZgoGXRrFShzpLiOsJ6W1ZFYLSMeSEO0QmyxTCumVD5IHTJU8TUFpsXgN2zrFmd+9AlPXXPoSgNjgbSdN4hdyqG4kIM9KX6q6SIYbRI9uwtHzk122WJBHcpNIZW+It0LTXEgMONaTHC4SFMKpMvKqZKRYMANNvjDjHcYGgdXa1PEC3EqfKAPAD8FiAYav7ZJQd/++07gSkqf8Fz9Yf3Lmo/+PqWgTVFBZprHQT0B10QdfRUEgVgwsQai9K+MiF8EBEryHDzetZuAeTadcmDkNdufyZlWI0cabNW3UIxyGS0StxygcWGDAFod95tGv1MbHM6kutpFLOtE5EnK9QrwK9YA8YYJwPpYDSTbPMO/nU3ikMI8vPBN0zNYqmacRfm4AejsuK+fs8nLZ/G5CZ5HIsM8exp3disoIyXvewTqsTLQ6z8eKQNPOrrEOiMnvC/bRGtKbQjNgl8x5EhBeilxS4voNjL8hfdiqszYlJlk7L1E9djoHAEphd1sqetlioKtlk6NardlIkCCsTOv7VHGcVxi5aJvmjGtEopb+mBsmLEGXqScFLzAyVyPNKTCvwqtO+RKV1wLKMSTKz5NqSYIwz8H562kGt0mA== 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)(52536014)(55016003)(64756008)(8676002)(4326008)(107886003)(8936002)(5660300002)(66556008)(66446008)(86362001)(66476007)(2906002)(38070700005)(6506007)(7696005)(508600001)(71200400001)(83380400001)(9686003)(53546011)(26005)(186003)(122000001)(82960400001)(38100700002)(66946007)(316002)(110136005)(54906003)(76116006)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?gPPHhN6sjzTHimd/AqFlTvz6oq8Mt6vQDahG2/KvgbvKKHvYaUQYEGQL?= =?Windows-1252?Q?BxQNvzlRTXXC33mOdW1BbF3Qh/57OwtnxoJCy+fFm5oNeP2WLlDlY8mz?= =?Windows-1252?Q?luy272h/UD0WES+bmqEFaU2xVBCNWVCE3aGgnIdtQpzjW9F0+Fv1GREQ?= =?Windows-1252?Q?7SURckhsSQrBnxKFqA2nQeMakU1wxwqfV6CyS/5mwuvJleFQoZ1P75gu?= =?Windows-1252?Q?ulAQe2cSI7PkiGzEWJd1AI0kPmVWFFJuoiwrYr7EWm9nTPK6UFweBKnY?= =?Windows-1252?Q?oTGaweCWFDlQ3MdHWYILqxkFTZD53nNvzLCuJfmcWddbEU/zP5HxDvYS?= =?Windows-1252?Q?JTppchihEJD3G89g0GIMPReo5OZ3g3w4JNmNms35r1NPNutfRWWUDNZ8?= =?Windows-1252?Q?7MPCGvpZNwfQtiefROkwUdnhvGQE8TKvRge7Ttv4nBk8q1n/NiIM2wr0?= =?Windows-1252?Q?lgCyHWb5EAqLiaEIa0teXS7yKCBkiM+5FwR6rnq8SbPzLsF1Qc+KLtcc?= =?Windows-1252?Q?9pRqltnDuZICmXykUn5ozGvlJh78xreHxEDKrcGBvAFEbtRf/78KyPgr?= =?Windows-1252?Q?vekd1DyK1j9vkPGGUibVTrvdqIZErfvfCjyeBb2DMMjHr5WfzxZNlI6X?= =?Windows-1252?Q?6gvGxCLfza1oamEysg2VREV5+kU3m1eC5zfHd9G+NS/O5XIBpZpXlBqn?= =?Windows-1252?Q?WwXc/Vc9R3R24K8XG9girnAMFJvzowyYM0DjuSYE/hps9Jjiq6eIcR11?= =?Windows-1252?Q?IjlFrVJPkPhnGRzNtYoyIVP8LvjLKbdKLsfl+88gQUsVMg3747OfvP5u?= =?Windows-1252?Q?AMU/8lbpVOOheTeqhrVzJyQc2SUaUi9Si/UrfTWTEnAhXAWOPU9HoKy4?= =?Windows-1252?Q?37q7n9gSdmRK69mXyS/tHI3odFg/qddcyAxlN8sL+qNPc/sq4B2DlnUk?= =?Windows-1252?Q?xsUEqKu2W13HY5vlJJsKZmMU4Wz9oruPOpFlSyvBH0/NqVK4wWRCg54Q?= =?Windows-1252?Q?wf0E9Bgkn88+/PZqpetpXYPIR4rj+tBD0P46CmJIOD+bNb8w5MK/xPYV?= =?Windows-1252?Q?9gTxM4HI0pkQJ9aj0BlyAgqRZUYmPCBBkUYdSwQTBzq5j6OBh0WjIbNz?= =?Windows-1252?Q?jf1LsDlc3QQki2Cn15Zo6Pl1UNF+JmIidaAqwI6kzD+5auGS9uHC9AnX?= =?Windows-1252?Q?8GQVodYkKq85why3JuEOGcZzs6iQKAPLbw935ZxrzAZA17SrUkNNpsuU?= =?Windows-1252?Q?9oEORKYJbQEGKYntubhSdPwDTCpdq2Q35wCN5ctr4OR/wyHCQVvqyGDX?= =?Windows-1252?Q?4CNrzsuD0gUm5+eks+Bjj/TP13fNkoalZ1UFTs6AaU6NlpTAeYRvQHch?= =?Windows-1252?Q?PG/WJKr1jMfv+nhB7ld4usSWAu+jQEqYYHJPxpV3/faAl385lQfR1ILz?= =?Windows-1252?Q?j0m+6Pa8AUfuMWVbrhYh2XwV03tMxpbnILVTlflj9PsWCw2tWQIngMU9?= =?Windows-1252?Q?TJxFKGoKKYjbGohy8jVmSb5jz3bLXklQFnJNzbN6wjSNicqlOWgDhtDd?= =?Windows-1252?Q?QmwpPoYJXkuxkmxN2qZHUKok3LjQ9Dt8iNS1nCC6STVDZESkm71UApHn?= =?Windows-1252?Q?Dfb0lbkBiZ9Pn5VYjmQ1RT6CwYOe5NI6MAG13EUeFOhIBbCJ6NEKZuzI?= =?Windows-1252?Q?sAhQRPM2fhR7VjsH+5PCzfN8lmW7lBNu3GDqCOaqjBCYf/4h6GlleA?= =?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: a7f3fa07-fa16-4a3e-e6fa-08d9f2e81cdb X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Feb 2022 14:08:17.9518 (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: +yyI3lXhsss7UftzS0NRPNfYr43WnNS0Ofqyp8XypqqDuWmqBAB5R8LVhLkL172DMTHUWDGPGoZ1WD3HqzLAjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4445 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: 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; >=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 Looks like the variable type of unsigned int is match the return type. So Acked-by: Fan Zhang