DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
To: <dev@dpdk.org>
Cc: <anoobj@marvell.com>, Akhil Goyal <gakhil@marvell.com>,
	Kai Ji <kai.ji@intel.com>, <tingtingx.liao@intel.com>,
	Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Subject: [PATCH] crypto/openssl: fix segfault due to uninitialized var
Date: Wed, 12 Jul 2023 00:18:57 +0530	[thread overview]
Message-ID: <0ce047dd9078d486ab7a317185fa1e0118c79299.1689100664.git.gmuthukrishn@marvell.com> (raw)

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(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 4569c5e62f..5e8624cebe 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -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 ||
-- 
2.25.1


             reply	other threads:[~2023-07-11 18:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 18:48 Gowrishankar Muthukrishnan [this message]
2023-07-12  5:30 ` Anoob Joseph
2023-07-12 16:48   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ce047dd9078d486ab7a317185fa1e0118c79299.1689100664.git.gmuthukrishn@marvell.com \
    --to=gmuthukrishn@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=kai.ji@intel.com \
    --cc=tingtingx.liao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).