Skip to contentSkip to conversation

crypto/ipsec_mb: fix ZUC PMD buffer initialisation

PATCH In review Ciara Power 3 participants 3 messages Oct 20, 2021 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/ipsec_mb: fix ZUC PMD buffer initialisation

The buffers used when processing a hash operation in the ZUC PMD should be initialised to empty before use.
This fixes possible "may be used uninitialised" errors on compilation.

Fixes e09b92e6474b ("drivers/crypto: move zuc PMD to IPsec-mb framework")
---
 drivers/crypto/ipsec_mb/pmd_zuc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/crypto/ipsec_mb/pmd_zuc.c +4 -4
index b542264069..2eae1d1ec7 100644
@@ -138,11 +138,11 @@ process_zuc_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,
 {
 	unsigned int i;
 	uint8_t processed_ops = 0;
-	uint8_t *src[ZUC_MAX_BURST];
+	uint8_t *src[ZUC_MAX_BURST] = { 0 };
 	uint32_t *dst[ZUC_MAX_BURST];
-	uint32_t length_in_bits[ZUC_MAX_BURST];
-	uint8_t *iv[ZUC_MAX_BURST];
-	const void *hash_keys[ZUC_MAX_BURST];
+	uint32_t length_in_bits[ZUC_MAX_BURST] = { 0 };
+	uint8_t *iv[ZUC_MAX_BURST] = { 0 };
+	const void *hash_keys[ZUC_MAX_BURST] = { 0 };
 	struct zuc_session *sess;
 	struct zuc_qp_data *qp_data = ipsec_mb_get_qp_private_data(qp);
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines

-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Wednesday, October 20, 2021 12:06 PM
To: [email protected]
Cc: Zhang, Roy Fan <[email protected]>; [email protected]; De Lara Guarch, Pablo <[email protected]>; [email protected]; Power, Ciara <[email protected]>; Bronowski, PiotrX <[email protected]>
Subject: [PATCH] crypto/ipsec_mb: fix ZUC PMD buffer initialisation

The buffers used when processing a hash operation in the ZUC PMD should be initialised to empty before use.
This fixes possible "may be used uninitialised" errors on compilation.

Quoted 6 lines
Fixes e09b92e6474b ("drivers/crypto: move zuc PMD to IPsec-mb

framework")
Cc: [email protected]

---