[PATCH v3] crypto/openssl: fix asym memory leaks

Thomas Monjalon thomas at monjalon.net
Mon Nov 13 16:24:13 CET 2023


13/11/2023 14:16, Ciara Power:
> 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.
> 
> Some cases need to be treated differently if OpenSSL < 3.0.
> It has slightly different handling of memory, as functions such as
> RSA_set0_key() take over memory management of values,
> so the caller should not free the values.
> 
> 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")
> Fixes: ad149f93093e ("crypto/openssl: fix memory leaks in asym ops")
> Cc: kai.ji at intel.com
> Cc: gmuthukrishn at marvell.com
> Cc: sunila.sahu at caviumnetworks.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ciara Power <ciara.power at intel.com>
> Acked-by: Kai Ji <kai.ji at intel.com>

Applied, thanks.





More information about the stable mailing list