patch 'raw/ntb: fix peer memory window count check' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 16 23:52:20 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/18/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/e883247d6a1db9f8c7109d2f8787d699e6937e55

Thanks.

Luca Boccassi

---
>From e883247d6a1db9f8c7109d2f8787d699e6937e55 Mon Sep 17 00:00:00 2001
From: Raghavendra Ningoji <raghavendra.ningoji at amd.com>
Date: Wed, 11 Nov 2026 12:36:36 +0530
Subject: [PATCH] raw/ntb: fix peer memory window count check

[ upstream commit 773a3fbeb9b5b38334e282c1866866911d65398d ]

The number of memory windows used by the peer is read from a
scratchpad register written by the peer, and is then used as the loop
bound to fill peer_mw_base[], which is allocated with mw_cnt entries.
A peer advertising more windows (bug, version mismatch, or a stale
scratchpad) makes the driver write past the end of this array.
On Intel, the 32-bit register value was also silently truncated into
the 8-bit peer_used_mws field.

Reject a peer configuration using more windows than the local device
has.

Fixes: c39d1e082a4b ("raw/ntb: setup queues")
Fixes: d6dc5a7f8b06 ("raw/ntb: support AMD NTB")

Signed-off-by: Raghavendra Ningoji <raghavendra.ningoji at amd.com>
---
 drivers/raw/ntb/ntb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index 0ed4c14592..45ee39ccd7 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -950,7 +950,13 @@ ntb_dev_start(struct rte_rawdev *dev)
 		goto err_up;
 	}
 
-	hw->peer_used_mws = (*hw->ntb_ops->spad_read)(dev, SPAD_USED_MWS, 0);
+	peer_val = (*hw->ntb_ops->spad_read)(dev, SPAD_USED_MWS, 0);
+	if (peer_val > hw->mw_cnt) {
+		NTB_LOG(ERR, "Peer used mws %u > mw cnt %u.", peer_val, hw->mw_cnt);
+		ret = -EINVAL;
+		goto err_up;
+	}
+	hw->peer_used_mws = peer_val;
 
 	for (i = 0; i < hw->peer_used_mws; i++) {
 		peer_base_h = (*hw->ntb_ops->spad_read)(dev,
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-16 22:52:19.118724858 +0000
+++ 0066-raw-ntb-fix-peer-memory-window-count-check.patch	2026-11-16 22:52:16.532234650 +0000
@@ -1 +1 @@
-From 773a3fbeb9b5b38334e282c1866866911d65398d Mon Sep 17 00:00:00 2001
+From e883247d6a1db9f8c7109d2f8787d699e6937e55 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 773a3fbeb9b5b38334e282c1866866911d65398d ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -23,38 +24,9 @@
- drivers/raw/ntb/ntb_hw_amd.c   | 10 ++++++++--
- drivers/raw/ntb/ntb_hw_intel.c |  7 ++++++-
- 2 files changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/raw/ntb/ntb_hw_amd.c b/drivers/raw/ntb/ntb_hw_amd.c
-index ab78675218..dba5b03671 100644
---- a/drivers/raw/ntb/ntb_hw_amd.c
-+++ b/drivers/raw/ntb/ntb_hw_amd.c
-@@ -502,7 +502,7 @@ static int
- amd_ntb_read_peer_config(const struct rte_rawdev *dev)
- {
- 	struct ntb_hw *ntb = dev->dev_private;
--	uint32_t info, peer_qps, peer_qsz, lo, hi;
-+	uint32_t info, peer_qps, peer_qsz, peer_used_mws, lo, hi;
- 	int i;
- 
- 	info = amd_ntb_spad_read(dev, AMD_SPAD_CNT_INFO, 0);
-@@ -520,7 +520,13 @@ amd_ntb_read_peer_config(const struct rte_rawdev *dev)
- 		return -EINVAL;
- 	}
- 
--	ntb->peer_used_mws = (info >> 16) & 0xff;
-+	peer_used_mws = (info >> 16) & 0xff;
-+	if (peer_used_mws > ntb->mw_cnt) {
-+		NTB_LOG(ERR, "Peer used mws %u > mw cnt %u.", peer_used_mws, ntb->mw_cnt);
-+		return -EINVAL;
-+	}
-+	ntb->peer_used_mws = peer_used_mws;
-+
- 	for (i = 0; i < ntb->peer_used_mws; i++) {
- 		lo = amd_ntb_spad_read(dev, AMD_SPAD_MW0_BA_L + 2 * i, 0);
- 		hi = amd_ntb_spad_read(dev, AMD_SPAD_MW0_BA_H + 2 * i, 0);
-diff --git a/drivers/raw/ntb/ntb_hw_intel.c b/drivers/raw/ntb/ntb_hw_intel.c
-index 1b784055ca..78fce9ffac 100644
---- a/drivers/raw/ntb/ntb_hw_intel.c
-+++ b/drivers/raw/ntb/ntb_hw_intel.c
-@@ -724,7 +724,12 @@ intel_ntb_read_peer_config(const struct rte_rawdev *dev)
- 		return -EINVAL;
+ drivers/raw/ntb/ntb.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
+index 0ed4c14592..45ee39ccd7 100644
+--- a/drivers/raw/ntb/ntb.c
++++ b/drivers/raw/ntb/ntb.c
+@@ -950,7 +950,13 @@ ntb_dev_start(struct rte_rawdev *dev)
+ 		goto err_up;
@@ -63,2 +35,2 @@
--	hw->peer_used_mws = intel_ntb_spad_read(dev, SPAD_USED_MWS, 0);
-+	peer_val = intel_ntb_spad_read(dev, SPAD_USED_MWS, 0);
+-	hw->peer_used_mws = (*hw->ntb_ops->spad_read)(dev, SPAD_USED_MWS, 0);
++	peer_val = (*hw->ntb_ops->spad_read)(dev, SPAD_USED_MWS, 0);
@@ -67 +39,2 @@
-+		return -EINVAL;
++		ret = -EINVAL;
++		goto err_up;
@@ -72 +45 @@
- 		peer_base_h = intel_ntb_spad_read(dev, SPAD_MW0_BA_H + 2 * i, 0);
+ 		peer_base_h = (*hw->ntb_ops->spad_read)(dev,


More information about the stable mailing list