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 3209A432BE for ; Tue, 7 Nov 2023 00:14:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2249F406FF; Tue, 7 Nov 2023 00:14:24 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 32F3140299; Tue, 7 Nov 2023 00:14:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699312461; x=1730848461; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=2SXlsVFuUkYFg2BwSGNMav9sFEz/nFv56v8ERdzdICk=; b=f51BS/ddrwn+jZDduBrvFosJwvFNrx/nuSBe+UV1w22/oqY6tS5piQe9 8/HDfg7EMTwHCagheAwaOs9Z3VqZbqR1fr79W+VVmh0apUZ3k6k9di+3h bN3ctTODNw2iAP3mTF6Q4yTjmJVn94GTbmwgEMcQ6pPVW0PFB4+A4nDUZ TpffQITEyzioXBYC6j9gkujyYXOBPQ7AQ/EeCWR1O4eFTB1dgTxr96uBL h/e+Fk5UdXVu3LGTF8BBcwjcjsq/EoJLZ5+jp3rc8JCtM8L3DxFAB2WPG VCeN/4hIad71YbWDe3FI4mDO6UCZ5G+CpXzsy+gGHzhWH81IhtMQcB08z w==; X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="368726886" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208,217";a="368726886" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 15:14:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="935939394" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208,217";a="935939394" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 06 Nov 2023 15:14:18 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.2507.34; Mon, 6 Nov 2023 15:14:17 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Mon, 6 Nov 2023 15:14:17 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Mon, 6 Nov 2023 15:14:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k1fLvGvXUDOszGB2/n9egDZMouP+V1gulITdFCbwrFGUmJQE+d2QgZEZBtTaJdc8Jx0Uc5502ztGKhTEFmyQkEu/vjG2Tl1r9V1B0Q0Irb/w50u75d6Cx8m6GEvRAdmfJFtNzTwmEWVed+Jw1rrqa5I1p6iMtNSPng2YpnpMu0HA8kfh29cp9+ZEvG333wK4QYeTWufvEm3IVI/KBzGIRiaTeQMh7zAx+aX9knunG7ztI5gYZzWc5Fvy3JcDtLBGZe0e2RAYHtmifSEasutkcI0KDyqKTvu829rF1YEVSPVgxFRj8Jk5TwCNIdWl3h9CMwAVdMOQzPtWsl1gx+5w+g== 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=2SXlsVFuUkYFg2BwSGNMav9sFEz/nFv56v8ERdzdICk=; b=NxDLf/tpuHt3Y10aDSSF3s8PgsJ02S7hbY1XYCzze4f+Vj2XbtoMs0E0nhjMN5WYwxYA9+eqMHcaN59WYyVktm+FBD3tAleGwzmhMJKgrjsTKLdzoq38SCtNw4IpESMydCSZXlKVk4cB+Vb0sKkN408EN2bTaOkbGtCPVcblv0cnyVBeZySIPRpLRf9Gz45BM06QF/oDLHsO+K8GIgFd3Meq4SJm8ko3DpGzqK3p7i7A8AzIwfX8Bjr5gkMpZcgQU/JFXPDMwxZ7UV2f2InxPwQjtlWJMaWxifnFwvZrczR5Rg4ARSFnjsYwlO/VYWt++xHGVmSFP2gs+f8k2JmkkA== 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 SN6PR11MB3408.namprd11.prod.outlook.com (2603:10b6:805:bc::22) by DS0PR11MB8113.namprd11.prod.outlook.com (2603:10b6:8:127::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 23:14:16 +0000 Received: from SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::53de:5700:449b:3f25]) by SN6PR11MB3408.namprd11.prod.outlook.com ([fe80::53de:5700:449b:3f25%5]) with mapi id 15.20.6954.028; Mon, 6 Nov 2023 23:14:16 +0000 From: "Ji, Kai" To: "Power, Ciara" , "dev@dpdk.org" CC: "gmuthukrishn@marvell.com" , "sunila.sahu@caviumnetworks.com" , "stable@dpdk.org" Subject: Re: [PATCH] crypto/openssl: fix asym memory leaks Thread-Topic: [PATCH] crypto/openssl: fix asym memory leaks Thread-Index: AQHaDmzK79GORU8RDEqM+KmEP+qmqrBt8JNP Date: Mon, 6 Nov 2023 23:14:16 +0000 Message-ID: References: <20231103154516.3456536-1-ciara.power@intel.com> In-Reply-To: <20231103154516.3456536-1-ciara.power@intel.com> Accept-Language: en-GB, en-US, en-IE Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3408:EE_|DS0PR11MB8113:EE_ x-ms-office365-filtering-correlation-id: 923ee148-98f8-4f54-1405-08dbdf1e18d6 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cJEtLJUeA8eJM7VmdxNa1FxmJjpuyJuQnOxprIPvqTp3g+X0jN0GlvLbfLn7+4pL5t1vLNyAAwHx0GZR4f1dm8/TGtl5mCH0CUqacb8Bqzzvdj940lZstt4rXRFvK+uvsQa/nklg3EqfuxVTbWNDEymnk3bvCEz5JTRLos4nRt/7i1e5LGvq4+0er+mr4+yJQ82cZYkXR+n/qWgylqJDen7Zmoj8oAkZe7QbcZM6QKvMDKwlG+iENmFE2680WJ7ajpwIIXFNn5ND+Np/ALN6jy3yl/ZCzI89WZm+VjboDNrUpWHgUodWLNgEJjLMdyQyXDKp/ZtI0qmWDNeVD5eQLSaguRMWsqKtFqPcg3XK3qOb5X5o0y6DKoX++wQUCsJt0lmPNiN029Bbc82en/IQtRpIu7EFVpOxdx6X4vS4PSMVY+enyTgs4I1Gc6DzpGPb5m+bfdhTtKpVOVc4NVfKmjj982COt+vCDqgqpKI4DvUVTEZru4GMI85Eoj8dUg1gwLfiSFpKLSTatBKD0cX1v8ZCfoUzCLuNrogrJXBbN3ULzPF3okLMfbTBYGIwm7vGC81/rKpWWzJReGMzKERAP1o56dlsk9LI0cYo0yZeQd1CuAGB6gnBL9TJPWp4ufYm x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3408.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(366004)(376002)(39860400002)(136003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(478600001)(6506007)(7696005)(71200400001)(53546011)(9686003)(83380400001)(4326008)(26005)(5660300002)(2906002)(66946007)(316002)(64756008)(66476007)(76116006)(54906003)(66446008)(110136005)(66556008)(52536014)(41300700001)(91956017)(8936002)(38070700009)(8676002)(38100700002)(86362001)(33656002)(122000001)(82960400001)(55016003)(19627405001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?T4xX1PcPICyT4owLhuUfDyxk1plYlj9b2ZTJ4A+jbDDkiRpFa22tU+o58n?= =?iso-8859-1?Q?5t6oJdYCwXAmalDVoWGty+UjNWEhuHkF6B6tx2ORCXnMrpFXglcZNW03yt?= =?iso-8859-1?Q?EZGOqRNoHHvT3yh2JYqspTpvFgJgiC6VOWF75sXNt8Z4f8K90qORQp+fNR?= =?iso-8859-1?Q?GkR4AJSIzzaU7Ow++5PVsAWwADlpg4eekpSWtz3r44YdkkAfqTgMxAMUbT?= =?iso-8859-1?Q?RkO3IUAP9tAeWXkrFRyROR7NgfTe35B8grcs9qr65cEAUlByjm4yLOpRA6?= =?iso-8859-1?Q?wPnvLsmaoFx9M6MajZdvOSKxbnFXXmE1TnWhNpf1A03HabCi9HvCj4udVe?= =?iso-8859-1?Q?TuSTqRQPi9pKLIhJcml7Ik6CjeV5/R6fvtKQgCWl3ZytCHBaO5PIgIxObj?= =?iso-8859-1?Q?v5Hlo5zWzkBqaxR3iw5hfL893cke6uFnNsXM3VP28qRZgE3aWTiWtXjSp2?= =?iso-8859-1?Q?aWbuOB6mf9zRHYNoonOJd2A3KP3UOCS45u+shLau2yCWrWnjNrWM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/OfP621lW7nrIryF+6X354Y+qqzaV54mKfs?= =?iso-8859-1?Q?TtB2thc720wOscY4L7l1YZuLjf3n55L3WlpdJGqoj5E9K7/sdxe4pEPush?= =?iso-8859-1?Q?jC47nlGE75mKOZlayeKHOYZ4/OMwDefF0SJS/IdEnW6kCKmBtGHaWfAekz?= =?iso-8859-1?Q?uvMDeAKy1xHnAuLFG3xINIpohYx1t18sy/DftoIQ+LTLUVSnkFEJP9w19G?= =?iso-8859-1?Q?5AT/Fec7TWYVY=3D?= Content-Type: multipart/alternative; boundary="_000_SN6PR11MB3408B2BE7F68771AA78B3CF181AAASN6PR11MB3408namp_" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3408.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 923ee148-98f8-4f54-1405-08dbdf1e18d6 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Nov 2023 23:14:16.1680 (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: AsCRRyV102Q3geopk3DrBlBK/pB76xaMsHD5C5BoBzeyb/OZm4oGd0+/pcoDWCc8BPJLQqdRq66SG9Sh+D82uQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8113 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --_000_SN6PR11MB3408B2BE7F68771AA78B3CF181AAASN6PR11MB3408namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Acked-by: Kai Ji > ________________________________ From: Power, Ciara Sent: 03 November 2023 15:45 To: dev@dpdk.org Cc: Power, Ciara ; Ji, Kai ; gmuth= ukrishn@marvell.com ; sunila.sahu@caviumnetworks.= com ; stable@dpdk.org Subject: [PATCH] crypto/openssl: fix asym memory leaks Numerous memory leaks were detected by ASAN in the OpenSSL PMD asymmetric code path. These are now fixed to free all variables allocated by OpenSSL functions such as BN_bin2bn and OSSL_PARAM_BLD_new. Some need to exist until the op is processed, for example the BIGNUMs associated with DSA. The pointers for these are added to the private asym session so they can be accessed later when calling free. Fixes: 4c7ae22f1f83 ("crypto/openssl: update DSA routine with 3.0 EVP API") Fixes: c794b40c9258 ("crypto/openssl: update DH routine with 3.0 EVP API") Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2") Fixes: ac42813a0a7c ("crypto/openssl: add DH and DSA asym operations") Fixes: d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP API") Cc: kai.ji@intel.com Cc: gmuthukrishn@marvell.com Cc: sunila.sahu@caviumnetworks.com Cc: stable@dpdk.org Signed-off-by: Ciara Power --- Depends-on: patch-133837 ("crypto/openssl: fix memory leaks in asym ops") --- 2.34.1 --_000_SN6PR11MB3408B2BE7F68771AA78B3CF181AAASN6PR11MB3408namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Acked-by: Kai Ji <kai.ji@intel.com&g= t;


From: Power,= Ciara <ciara.power@intel.com>
Sent: 03 November 2023 15:45
To: dev@dpdk.org <dev@dpdk.org>
Cc: Power, Ciara <ciara.power@intel.com>; Ji, Kai <kai= .ji@intel.com>; gmuthukrishn@marvell.com <gmuthukrishn@marvell.com>= ;; sunila.sahu@caviumnetworks.com <sunila.sahu@caviumnetworks.com>; s= table@dpdk.org <stable@dpdk.org>
Subject: [PATCH] crypto/openssl: fix asym memory leaks
 
Numerous mem= ory leaks were detected by ASAN
in the OpenSSL PMD asymmetric code path.

These are now fixed to free all variables allocated
by OpenSSL functions such as BN_bin2bn and
OSSL_PARAM_BLD_new.

Some need to exist until the op is processed,
for example the BIGNUMs associated with DSA.
The pointers for these are added to the private
asym session so they can be accessed later when calling free.

Fixes: 4c7ae22f1f83 ("crypto/openssl: update DSA routine with 3.0 EVP = API")
Fixes: c794b40c9258 ("crypto/openssl: update DH routine with 3.0 EVP A= PI")
Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2") Fixes: ac42813a0a7c ("crypto/openssl: add DH and DSA asym operations&q= uot;)
Fixes: d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP = API")
Cc: kai.ji@intel.com
Cc: gmuthukrishn@marvell.com
Cc: sunila.sahu@caviumnetworks.com
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
Depends-on: patch-133837 ("crypto/openssl: fix memory leaks in asym op= s")
---
2.34.1

--_000_SN6PR11MB3408B2BE7F68771AA78B3CF181AAASN6PR11MB3408namp_--