patch 'common/cnxk: check representor count before copying map' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 16 23:51:43 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/f12cad35ea4f99462df55d85c00ba4dc6505490e
Thanks.
Luca Boccassi
---
>From f12cad35ea4f99462df55d85c00ba4dc6505490e Mon Sep 17 00:00:00 2001
From: Aarnav JP <ajp at marvell.com>
Date: Mon, 2 Nov 2026 17:51:53 +0530
Subject: [PATCH] common/cnxk: check representor count before copying map
[ upstream commit f5e02a008975584851898f6a4802daf23e8c3952 ]
roc_nix_max_rep_count() copied rsp->rep_cnt entries from the get_rep_cnt
mailbox response into the fixed 64-entry roc_nix->rep_pfvf_map[] without
validating the AF-supplied count. rep_cnt is a uint16_t, so a malformed
or malicious AF response could overrun the array (and read past the
response's 64-entry map), corrupting adjacent driver state.
Reject responses with rep_cnt greater than MAX_PFVF_REP before copying.
Fixes: 162c77c18838 ("common/cnxk: add support for representors")
Signed-off-by: Aarnav JP <ajp at marvell.com>
---
drivers/common/cnxk/roc_nix.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c
index e4d7e11121..d446d205ac 100644
--- a/drivers/common/cnxk/roc_nix.c
+++ b/drivers/common/cnxk/roc_nix.c
@@ -575,6 +575,12 @@ roc_nix_max_rep_count(struct roc_nix *roc_nix)
if (rc)
goto exit;
+ if (rsp->rep_cnt > MAX_PFVF_REP) {
+ plt_err("Invalid rep_cnt %u in get_rep_cnt rsp", rsp->rep_cnt);
+ rc = -EIO;
+ goto exit;
+ }
+
roc_nix->rep_cnt = rsp->rep_cnt;
for (i = 0; i < rsp->rep_cnt; i++)
roc_nix->rep_pfvf_map[i] = rsp->rep_pfvf_map[i];
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-16 22:52:17.668995679 +0000
+++ 0029-common-cnxk-check-representor-count-before-copying-m.patch 2026-11-16 22:52:16.456232636 +0000
@@ -1 +1 @@
-From f5e02a008975584851898f6a4802daf23e8c3952 Mon Sep 17 00:00:00 2001
+From f12cad35ea4f99462df55d85c00ba4dc6505490e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f5e02a008975584851898f6a4802daf23e8c3952 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 8e3903051d..ae6a918682 100644
+index e4d7e11121..d446d205ac 100644
@@ -26 +27 @@
-@@ -589,6 +589,12 @@ roc_nix_max_rep_count(struct roc_nix *roc_nix)
+@@ -575,6 +575,12 @@ roc_nix_max_rep_count(struct roc_nix *roc_nix)
More information about the stable
mailing list