patch 'net/mlx5/hws: fix buddy memory allocation' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Nov 21 12:21:13 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.4

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/26/25. 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/c9894fd65cd95d579cc0c6f98910d49644149b8a

Thanks.

Kevin

---
>From c9894fd65cd95d579cc0c6f98910d49644149b8a Mon Sep 17 00:00:00 2001
From: Nupur Uttarwar <nuttarwar at nvidia.com>
Date: Wed, 12 Nov 2025 09:47:39 +0200
Subject: [PATCH] net/mlx5/hws: fix buddy memory allocation

[ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ]

`buddy` was erroroneously declared as static. When multiple
threads call this routine, they set the same static variable
corrupting pool data and can cause potential double free when
releasing resources.

Fixes: b4dd7bcb0dcb ("net/mlx5/hws: add pool and buddy")

Signed-off-by: Nupur Uttarwar <nuttarwar at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 .mailmap                            | 1 +
 drivers/net/mlx5/hws/mlx5dr_buddy.c | 1 +
 drivers/net/mlx5/hws/mlx5dr_pool.c  | 3 +--
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 228bd1af42..723b168e04 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1135,4 +1135,5 @@ Nobuhiro Miki <nmiki at yahoo-corp.jp>
 Norbert Ciosek <norbertx.ciosek at intel.com>
 Norbert Zulinski <norbertx.zulinski at intel.com>
+Nupur Uttarwar <nuttarwar at nvidia.com>
 Odi Assli <odia at nvidia.com>
 Ofer Dagan <ofer.d at claroty.com>
diff --git a/drivers/net/mlx5/hws/mlx5dr_buddy.c b/drivers/net/mlx5/hws/mlx5dr_buddy.c
index 394ca71217..abfbdf1be5 100644
--- a/drivers/net/mlx5/hws/mlx5dr_buddy.c
+++ b/drivers/net/mlx5/hws/mlx5dr_buddy.c
@@ -148,4 +148,5 @@ void mlx5dr_buddy_cleanup(struct mlx5dr_buddy_mem *buddy)
 	simple_free(buddy->num_free);
 	simple_free(buddy->bits);
+	simple_free(buddy);
 }
 
diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.c b/drivers/net/mlx5/hws/mlx5dr_pool.c
index b7b532c7cf..a99182e0ca 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pool.c
+++ b/drivers/net/mlx5/hws/mlx5dr_pool.c
@@ -168,5 +168,5 @@ mlx5dr_pool_buddy_get_next_buddy(struct mlx5dr_pool *pool, int idx,
 				 uint32_t order, bool *is_new_buddy)
 {
-	static struct mlx5dr_buddy_mem *buddy;
+	struct mlx5dr_buddy_mem *buddy;
 	uint32_t new_buddy_size;
 
@@ -272,5 +272,4 @@ static void mlx5dr_pool_buddy_db_uninit(struct mlx5dr_pool *pool)
 		if (buddy) {
 			mlx5dr_buddy_cleanup(buddy);
-			simple_free(buddy);
 			pool->db.buddy_manager->buddies[i] = NULL;
 		}
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-21 11:05:12.319143856 +0000
+++ 0089-net-mlx5-hws-fix-buddy-memory-allocation.patch	2025-11-21 11:05:09.593201724 +0000
@@ -1 +1 @@
-From 8d1fe10768d2749d00ceb7124866c61d31164380 Mon Sep 17 00:00:00 2001
+From c9894fd65cd95d579cc0c6f98910d49644149b8a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ]
+
@@ -22 +24 @@
-index f9c5622e5d..efc66fd48c 100644
+index 228bd1af42..723b168e04 100644
@@ -25 +27 @@
-@@ -1181,4 +1181,5 @@ Nobuhiro Miki <nmiki at yahoo-corp.jp>
+@@ -1135,4 +1135,5 @@ Nobuhiro Miki <nmiki at yahoo-corp.jp>
@@ -42 +44 @@
-index 8e3718ac42..e383027d3e 100644
+index b7b532c7cf..a99182e0ca 100644



More information about the stable mailing list