DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicolas Chautru <nicolas.chautru@intel.com>
To: dev@dpdk.org, gakhil@marvell.com
Cc: john.mcnamara@intel.com, sean.morrissey@intel.com,
	trix@redhat.com, Nicolas Chautru <nicolas.chautru@intel.com>
Subject: [PATCH v1] baseband/acc100: avoid out-of-bounds access corner cases
Date: Tue, 22 Feb 2022 15:43:36 -0800	[thread overview]
Message-ID: <1645573416-165364-1-git-send-email-nicolas.chautru@intel.com> (raw)

Coverity issue: 375803, 375813, 375819, 375827, 375831
The actual maximum number of gather pointers should have been limited
Fixes: 5ad5060f8f7a ("baseband/acc100: add LDPC processing functions")

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 3 +--
 drivers/baseband/acc100/rte_acc100_pmd.h | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index 1c6080f..cc69c76 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -1460,8 +1460,7 @@
 	next_triplet++;
 
 	while (cb_len > 0) {
-		if (next_triplet < ACC100_DMA_MAX_NUM_POINTERS &&
-				m->next != NULL) {
+		if (next_triplet < ACC100_DMA_MAX_NUM_POINTERS_IN && m->next != NULL) {
 
 			m = m->next;
 			*seg_total_left = rte_pktmbuf_data_len(m);
diff --git a/drivers/baseband/acc100/rte_acc100_pmd.h b/drivers/baseband/acc100/rte_acc100_pmd.h
index 03ed0b3..cbcece2 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.h
+++ b/drivers/baseband/acc100/rte_acc100_pmd.h
@@ -113,6 +113,7 @@
 #define ACC100_SW_RING_MEM_ALLOC_ATTEMPTS 5
 #define ACC100_MAX_QUEUE_DEPTH            1024
 #define ACC100_DMA_MAX_NUM_POINTERS       14
+#define ACC100_DMA_MAX_NUM_POINTERS_IN    7
 #define ACC100_DMA_DESC_PADDING           8
 #define ACC100_FCW_PADDING                12
 #define ACC100_DESC_FCW_OFFSET            192
-- 
1.8.3.1


             reply	other threads:[~2022-02-23  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 23:43 Nicolas Chautru [this message]
2022-02-23 11:01 ` [EXT] " 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=1645573416-165364-1-git-send-email-nicolas.chautru@intel.com \
    --to=nicolas.chautru@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=sean.morrissey@intel.com \
    --cc=trix@redhat.com \
    /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).