[PATCH v1 2/3] crypto/nitrox: use timing-safe salt comparison
Rupesh Chiluka
rchiluka at marvell.com
Mon Aug 3 08:24:14 CEST 2026
softreq_copy_salt() compared the session salt with the IV salt using
memcmp(), which returns early on the first differing byte and can leak
timing information about the salt value.
Use rte_memeq_timingsafe() for the salt comparison.
Bugzilla ID: 1773
Signed-off-by: Rupesh Chiluka <rchiluka at marvell.com>
---
drivers/crypto/nitrox/nitrox_sym_reqmgr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/nitrox/nitrox_sym_reqmgr.c b/drivers/crypto/nitrox/nitrox_sym_reqmgr.c
index 7751c1a9fc..728c80b84f 100644
--- a/drivers/crypto/nitrox/nitrox_sym_reqmgr.c
+++ b/drivers/crypto/nitrox/nitrox_sym_reqmgr.c
@@ -684,7 +684,7 @@ softreq_copy_salt(struct nitrox_softreq *sr)
}
addr = rte_crypto_op_ctod_offset(sr->op, uint8_t *, ctx->iv.offset);
- if (!memcmp(ctx->salt, addr, AES_GCM_SALT_SIZE))
+ if (rte_memeq_timingsafe(ctx->salt, addr, AES_GCM_SALT_SIZE))
return 0;
memcpy(ctx->salt, addr, AES_GCM_SALT_SIZE);
--
2.48.1
More information about the dev
mailing list