Skip to contentSkip to conversation

crypto/ipsec_mb: fix buffer overrun

PATCH Applied Pablo de Lara 3 participants 3 messages Jan 20, 2022 – Feb 8, 2022 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto/ipsec_mb: fix buffer overrun

Memory for ZUC cipher/auth key in session had to be expanded to 32 bytes, instead of 16 bytes, when adding ZUC-256 support.
However, impact is low as this memory is part of a union
with bigger size than 32 bytes.

Coverity issue: 374374
Coverity issue: 374379

Fixes 8c835018de84 ("crypto/ipsec_mb: support ZUC-256 for aesni_mb")
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/ipsec_mb/pmd_aesni_mb_priv.h +2 -2
index d37cc787a0..d177961ea5 100644
@@ -848,7 +848,7 @@ struct aesni_mb_session {
 
 			struct gcm_key_data gcm_key;
 			/* *< Expanded GCM key */
-			uint8_t zuc_cipher_key[16];
+			uint8_t zuc_cipher_key[32];
 			/* *< ZUC cipher key */
 			snow3g_key_schedule_t pKeySched_snow3g_cipher;
 			/* *< SNOW3G scheduled cipher key */
@@ -893,7 +893,7 @@ struct aesni_mb_session {
 				/* *< k3. */
 			} cmac;
 			/* *< Expanded XCBC authentication keys */
-			uint8_t zuc_auth_key[16];
+			uint8_t zuc_auth_key[32];
 			/* *< ZUC authentication key */
 			snow3g_key_schedule_t pKeySched_snow3g_auth;
 			/* *< SNOW3G scheduled authentication key */
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw

Hi Pablo,

Quoted 20 lines

-----Original Message-----
From: De Lara Guarch, Pablo <[email protected]>
Sent: Thursday 20 January 2022 17:05
To: Zhang, Roy Fan <[email protected]>; Power, Ciara <[email protected]>
Cc: [email protected]; De Lara Guarch, Pablo <[email protected]>; [email protected]
Subject: [PATCH] crypto/ipsec_mb: fix buffer overrun

Memory for ZUC cipher/auth key in session had to be expanded to 32 bytes, instead of 16 bytes, when adding ZUC-256 support.
However, impact is low as this memory is part of a union with bigger size than 32 bytes.

Coverity issue: 374374
Coverity issue: 374379

Fixes 8c835018de84 ("crypto/ipsec_mb: support ZUC-256 for aesni_mb")

<snip>

Applied
#2 lore raw
Quoted 10 lines
Quoted 10 lines

Memory for ZUC cipher/auth key in session had to be expanded to 32 bytes, instead of 16 bytes, when adding ZUC-256 support.
However, impact is low as this memory is part of a union with bigger size than 32 bytes.

Coverity issue: 374374
Coverity issue: 374379

Fixes 8c835018de84 ("crypto/ipsec_mb: support ZUC-256 for aesni_mb")
Quoted 4 lines
Quoted 1 line

<snip>

Applied to dpdk-next-crypto