crypto/openssl: fix segfault due to uninitialized var
Checks
Commit Message
In some openSSL 3 libraries, uninitialized output variable
cause segfault. It is always nice to initialize it.
Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2")
Bugzilla ID: 1250
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
drivers/crypto/openssl/rte_openssl_pmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
>
> In some openSSL 3 libraries, uninitialized output variable cause segfault. It is
> always nice to initialize it.
>
> Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2") Bugzilla ID:
> 1250
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
> Subject: RE: [PATCH] crypto/openssl: fix segfault due to uninitialized var
>
> >
> > In some openSSL 3 libraries, uninitialized output variable cause segfault. It is
> > always nice to initialize it.
> >
> > Fixes: 3b7d638fb11f ("crypto/openssl: support asymmetric SM2") Bugzilla ID:
> > 1250
> >
> > Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
>
> Acked-by: Anoob Joseph <anoobj@marvell.com>
Applied to dpdk-next-crypto
Thanks. Will be part of RC4, as RC3 is already tagged.
@@ -2734,7 +2734,7 @@ process_openssl_sm2_op_evp(struct rte_crypto_op *cop,
case RTE_CRYPTO_ASYM_OP_ENCRYPT:
{
OSSL_PARAM *eparams = sess->u.sm2.params;
- size_t output_len;
+ size_t output_len = 0;
kctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SM2, NULL);
if (kctx == NULL || EVP_PKEY_fromdata_init(kctx) <= 0 ||