DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] crypto/ipsec_mb: fix usage of untrusted value
@ 2022-03-07 12:48 Piotr Bronowski
  2022-03-07 15:32 ` [PATCH v2] " Piotr Bronowski
  0 siblings, 1 reply; 10+ messages in thread
From: Piotr Bronowski @ 2022-03-07 12:48 UTC (permalink / raw)
  To: dev
  Cc: roy.fan.zhang, thomas, gakhil, ferruh.yigit, declan.doherty,
	Piotr Bronowski

This patch removes coverity defect CID 375828:
Untrusted value as argument (TAINTED_SCALAR)

Coverity issue: CID 375828
Fixes: 918fd2f1466b ("crypto/ipsec_mb: move aesni_mb PMD")

Signed-off-by: Piotr Bronowski <piotrx.bronowski@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_gcm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c
index e5ad629fe5..f735b77680 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_gcm.c
@@ -206,6 +206,9 @@ post_process_gcm_crypto_op(struct ipsec_mb_qp *qp,
 			op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
 	} else {
 		if (session->req_digest_length != session->gen_digest_length) {
+			session->req_digest_length =
+				RTE_MIN(session->req_digest_length,
+						DIGEST_LENGTH_MAX);
 			if (session->op ==
 				IPSEC_MB_OP_AEAD_AUTHENTICATED_ENCRYPT)
 				memcpy(op->sym->aead.digest.data,
-- 
2.30.2

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.


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

end of thread, other threads:[~2022-03-14 10:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 12:48 [PATCH] crypto/ipsec_mb: fix usage of untrusted value Piotr Bronowski
2022-03-07 15:32 ` [PATCH v2] " Piotr Bronowski
2022-03-07 16:26   ` Zhang, Roy Fan
2022-03-09 13:19     ` Ji, Kai
2022-03-09 14:34     ` Zhang, Roy Fan
2022-03-09 14:40       ` Power, Ciara
2022-03-09 15:08   ` [PATCH v3] crypto/ipsec_mb: fix coverity issue Piotr Bronowski
2022-03-09 18:02     ` [PATCH v4] " Piotr Bronowski
2022-03-10  9:17       ` Power, Ciara
2022-03-14 10:32         ` Thomas Monjalon

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