DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Boyer <andrew.boyer@amd.com>
To: <dev@dpdk.org>
Cc: Andrew Boyer <andrew.boyer@amd.com>
Subject: [PATCH 2/2] crypto/ionic: fix sign extension in queue allocation
Date: Mon, 1 Jul 2024 08:22:50 -0700	[thread overview]
Message-ID: <20240701152250.46978-2-andrew.boyer@amd.com> (raw)
In-Reply-To: <20240701152250.46978-1-andrew.boyer@amd.com>

(uint16_t * uint16_t) promoted to uint64_t has a sign extension
problem reported by Coverity. Cast one arg to uint64_t first
to eliminate the sign extension.

Coverity issue: 426422
Coverity issue: 426427
Fixes: 2c1662bb53ca ("crypto/ionic: add adminq command")

Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
 drivers/crypto/ionic/ionic_crypto_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/ionic/ionic_crypto_main.c b/drivers/crypto/ionic/ionic_crypto_main.c
index 9960dc3a6d..f670d6e658 100644
--- a/drivers/crypto/ionic/ionic_crypto_main.c
+++ b/drivers/crypto/ionic/ionic_crypto_main.c
@@ -88,7 +88,7 @@ iocpt_q_init(struct iocpt_queue *q, uint8_t type, uint32_t index,
 	q->tail_idx = 0;
 
 	q->info = rte_calloc_socket("iocpt",
-				num_descs * num_segs, sizeof(void *),
+				(uint64_t)num_descs * num_segs, sizeof(void *),
 				rte_mem_page_size(), socket_id);
 	if (q->info == NULL) {
 		IOCPT_PRINT(ERR, "Cannot allocate queue info");
-- 
2.17.1


  reply	other threads:[~2024-07-01 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 15:22 [PATCH 1/2] crypto/ionic: fix buffer overrun when writing session Andrew Boyer
2024-07-01 15:22 ` Andrew Boyer [this message]
2024-07-03 17:30 ` [EXTERNAL] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701152250.46978-2-andrew.boyer@amd.com \
    --to=andrew.boyer@amd.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).