patch 'dma/odm: fix zero-length DMA transfer' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Thu Jul 23 19:15:55 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/27/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/92a7cbeab374a28a87ddc9024d373a751d6f6e85

Thanks.

Kevin

---
>From 92a7cbeab374a28a87ddc9024d373a751d6f6e85 Mon Sep 17 00:00:00 2001
From: Shijith Thotton <sthotton at marvell.com>
Date: Mon, 1 Jun 2026 15:45:59 +0530
Subject: [PATCH] dma/odm: fix zero-length DMA transfer

[ upstream commit daa5308577a16bb412c6ebd899a60e776fb31996 ]

Add validation to reject zero-length DMA operations early
with -EINVAL, preventing queue disable.

Fixes: c57d26fa61cc ("dma/odm: add copy ops")

Signed-off-by: Shijith Thotton <sthotton at marvell.com>
---
 drivers/dma/odm/odm_dmadev.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/odm/odm_dmadev.c b/drivers/dma/odm/odm_dmadev.c
index a2f4ed9a8e..bb334e19cc 100644
--- a/drivers/dma/odm/odm_dmadev.c
+++ b/drivers/dma/odm/odm_dmadev.c
@@ -109,4 +109,7 @@ odm_dmadev_copy(void *dev_private, uint16_t vchan, rte_iova_t src, rte_iova_t ds
 	vq = &odm->vq[vchan];
 
+	if (unlikely(!length))
+		return -EINVAL;
+
 	h = length;
 	h |= ((uint64_t)length << 32);
@@ -260,12 +263,18 @@ odm_dmadev_copy_sg(void *dev_private, uint16_t vchan, const struct rte_dma_sge *
 	pending_submit_cnt = vq->pending_submit_cnt;
 
-	if (unlikely(nb_src > 4 || nb_dst > 4))
+	if (unlikely(!nb_src || nb_src > 4 || !nb_dst || nb_dst > 4))
 		return -EINVAL;
 
-	for (i = 0; i < nb_src; i++)
+	for (i = 0; i < nb_src; i++) {
+		if (unlikely(!src[i].length))
+			return -EINVAL;
 		s_sz += src[i].length;
+	}
 
-	for (i = 0; i < nb_dst; i++)
+	for (i = 0; i < nb_dst; i++) {
+		if (unlikely(!dst[i].length))
+			return -EINVAL;
 		d_sz += dst[i].length;
+	}
 
 	if (s_sz != d_sz)
@@ -340,4 +349,7 @@ odm_dmadev_fill(void *dev_private, uint16_t vchan, uint64_t pattern, rte_iova_t
 	};
 
+	if (unlikely(!length))
+		return -EINVAL;
+
 	h = (uint64_t)length;
 
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-23 17:58:01.284861301 +0100
+++ 0092-dma-odm-fix-zero-length-DMA-transfer.patch	2026-07-23 17:57:58.715217054 +0100
@@ -1 +1 @@
-From daa5308577a16bb412c6ebd899a60e776fb31996 Mon Sep 17 00:00:00 2001
+From 92a7cbeab374a28a87ddc9024d373a751d6f6e85 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit daa5308577a16bb412c6ebd899a60e776fb31996 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 0211133bd4..7488b960fd 100644
+index a2f4ed9a8e..bb334e19cc 100644
@@ -21,2 +22,2 @@
-@@ -111,4 +111,7 @@ odm_dmadev_copy(void *dev_private, uint16_t vchan, rte_iova_t src, rte_iova_t ds
- 	hdr.s.xtype = vq->xtype;
+@@ -109,4 +109,7 @@ odm_dmadev_copy(void *dev_private, uint16_t vchan, rte_iova_t src, rte_iova_t ds
+ 	vq = &odm->vq[vchan];
@@ -29 +30 @@
-@@ -263,12 +266,18 @@ odm_dmadev_copy_sg(void *dev_private, uint16_t vchan, const struct rte_dma_sge *
+@@ -260,12 +263,18 @@ odm_dmadev_copy_sg(void *dev_private, uint16_t vchan, const struct rte_dma_sge *
@@ -51 +52 @@
-@@ -343,4 +352,7 @@ odm_dmadev_fill(void *dev_private, uint16_t vchan, uint64_t pattern, rte_iova_t
+@@ -340,4 +349,7 @@ odm_dmadev_fill(void *dev_private, uint16_t vchan, uint64_t pattern, rte_iova_t



More information about the stable mailing list