patch 'raw/cnxk_gpio: fix out-of-bound access for negative GPIO' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Oct 27 12:50:00 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 10/29/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/8a44a14989c8f227e7b9ae1a8ea04d8b735452ac

Thanks.

Luca Boccassi

---
>From 8a44a14989c8f227e7b9ae1a8ea04d8b735452ac Mon Sep 17 00:00:00 2001
From: Akhil Goyal <gakhil at marvell.com>
Date: Fri, 7 Aug 2026 15:46:30 +0530
Subject: [PATCH] raw/cnxk_gpio: fix out-of-bound access for negative GPIO

[ upstream commit 6700cb27d91b3b2e7a1f192d22d9e6004db08863 ]

cnxk_gpio_valid(struct cnxk_gpiochip *gpiochip, int gpio)
validates the GPIO number with only an upper bound while gpio
can be wrongly configured as negative value from application.
Added a check to reject negative values.

Fixes: ecc0dd455e9a ("raw/cnxk_gpio: add option to select subset of GPIOs")

Signed-off-by: Akhil Goyal <gakhil at marvell.com>
---
 drivers/raw/cnxk_gpio/cnxk_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c
index 329ac28a273..62bd0ba9cdd 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c
@@ -658,7 +658,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)
 static bool
 cnxk_gpio_valid(struct cnxk_gpiochip *gpiochip, int gpio)
 {
-	return gpio < gpiochip->num_gpios && gpiochip->gpios[gpio];
+	return (gpio >= 0) && (gpio < gpiochip->num_gpios) && gpiochip->gpios[gpio];
 }
 
 static int
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-10-27 11:43:57.848812263 +0000
+++ 0106-raw-cnxk_gpio-fix-out-of-bound-access-for-negative-G.patch	2026-10-27 11:43:53.642063410 +0000
@@ -1 +1 @@
-From 6700cb27d91b3b2e7a1f192d22d9e6004db08863 Mon Sep 17 00:00:00 2001
+From 8a44a14989c8f227e7b9ae1a8ea04d8b735452ac Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6700cb27d91b3b2e7a1f192d22d9e6004db08863 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 0549e326f9..e22fb7cf7b 100644
+index 329ac28a273..62bd0ba9cdd 100644
@@ -23 +24 @@
-@@ -795,7 +795,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)
+@@ -658,7 +658,7 @@ cnxk_gpio_process_buf(struct cnxk_gpio *gpio, struct rte_rawdev_buf *rbuf)


More information about the stable mailing list