DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test/crypto: use standard memory copy for wireless cipher IV
@ 2026-11-17 14:51 Kai Ji
  2026-11-17 15:54 ` [EXTERNAL] " Akhil Goyal
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Ji @ 2026-11-17 14:51 UTC (permalink / raw)
  To: dev; +Cc: Kai Ji, Akhil Goyal, Fan Zhang

Coverity reports an out-of-bounds read of the ZUC cipher IV when tracing
the optimized rte_memcpy() implementation. The ZUC test vectors use
16-byte or 25-byte IVs, which fit in the 64-byte source buffer.

Use memcpy() for IV copies in both the in-place and out-of-place
wireless cipher operation helpers. These small test setup copies do
not need the optimized packet data copy routine. The copy lengths
and operation layout remain unchanged.

Coverity issue: 507468

Signed-off-by: Kai Ji <kai.ji@intel.com>
---
 app/test/test_cryptodev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index fd02107baf..312fb61189 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -3007,7 +3007,7 @@ create_wireless_algo_cipher_operation(const uint8_t *iv, uint8_t iv_len,
 	sym_op->m_src = ut_params->ibuf;
 
 	/* iv */
-	rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+	memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
 			iv, iv_len);
 	sym_op->cipher.data.length = cipher_len;
 	sym_op->cipher.data.offset = cipher_offset;
@@ -3038,7 +3038,7 @@ create_wireless_algo_cipher_operation_oop(const uint8_t *iv, uint8_t iv_len,
 	sym_op->m_dst = ut_params->obuf;
 
 	/* iv */
-	rte_memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
+	memcpy(rte_crypto_op_ctod_offset(ut_params->op, uint8_t *, IV_OFFSET),
 			iv, iv_len);
 	sym_op->cipher.data.length = cipher_len;
 	sym_op->cipher.data.offset = cipher_offset;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-17 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 14:51 [PATCH] test/crypto: use standard memory copy for wireless cipher IV Kai Ji
2026-11-17 15:54 ` [EXTERNAL] " Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox