patch 'net/mlx5/hws: fix buddy memory allocation' has been queued to stable release 22.11.11
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 20 13:44:47 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.11
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/22/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3d4cdeff7fe3ebe14e475147c4ba9be84bb5571c
Thanks.
Luca Boccassi
---
>From 3d4cdeff7fe3ebe14e475147c4ba9be84bb5571c 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 e540177a1f..e831062a09 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1033,6 +1033,7 @@ Nitzan Weller <nitzanwe at mellanox.com>
Noa Ezra <noae at mellanox.com>
Nobuhiro Miki <nmiki at yahoo-corp.jp>
Norbert Ciosek <norbertx.ciosek at intel.com>
+Nupur Uttarwar <nuttarwar at nvidia.com>
Odi Assli <odia at nvidia.com>
Ofer Dagan <ofer.d at claroty.com>
Ognjen Joldzic <ognjen.joldzic at gmail.com>
diff --git a/drivers/net/mlx5/hws/mlx5dr_buddy.c b/drivers/net/mlx5/hws/mlx5dr_buddy.c
index cde4f54f66..c4a558ba5e 100644
--- a/drivers/net/mlx5/hws/mlx5dr_buddy.c
+++ b/drivers/net/mlx5/hws/mlx5dr_buddy.c
@@ -147,6 +147,7 @@ void mlx5dr_buddy_cleanup(struct mlx5dr_buddy_mem *buddy)
simple_free(buddy->num_free);
simple_free(buddy->bits);
+ simple_free(buddy);
}
int mlx5dr_buddy_alloc_mem(struct mlx5dr_buddy_mem *buddy, int order)
diff --git a/drivers/net/mlx5/hws/mlx5dr_pool.c b/drivers/net/mlx5/hws/mlx5dr_pool.c
index af6a5c743b..98e2436d1f 100644
--- a/drivers/net/mlx5/hws/mlx5dr_pool.c
+++ b/drivers/net/mlx5/hws/mlx5dr_pool.c
@@ -167,7 +167,7 @@ static struct mlx5dr_buddy_mem *
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;
buddy = pool->db.buddy_manager->buddies[idx];
@@ -271,7 +271,6 @@ static void mlx5dr_pool_buddy_db_uninit(struct mlx5dr_pool *pool)
buddy = pool->db.buddy_manager->buddies[i];
if (buddy) {
mlx5dr_buddy_cleanup(buddy);
- simple_free(buddy);
pool->db.buddy_manager->buddies[i] = NULL;
}
}
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-11-20 12:44:13.324110874 +0000
+++ 0015-net-mlx5-hws-fix-buddy-memory-allocation.patch 2025-11-20 12:44:12.790088272 +0000
@@ -1 +1 @@
-From 8d1fe10768d2749d00ceb7124866c61d31164380 Mon Sep 17 00:00:00 2001
+From 3d4cdeff7fe3ebe14e475147c4ba9be84bb5571c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8d1fe10768d2749d00ceb7124866c61d31164380 ]
+
@@ -22 +24 @@
-index f9c5622e5d..efc66fd48c 100644
+index e540177a1f..e831062a09 100644
@@ -25 +27,2 @@
-@@ -1180,6 +1180,7 @@ Noa Ezra <noae at mellanox.com>
+@@ -1033,6 +1033,7 @@ Nitzan Weller <nitzanwe at mellanox.com>
+ Noa Ezra <noae at mellanox.com>
@@ -28 +30,0 @@
- Norbert Zulinski <norbertx.zulinski at intel.com>
@@ -34 +36 @@
-index 394ca71217..abfbdf1be5 100644
+index cde4f54f66..c4a558ba5e 100644
@@ -46 +48 @@
-index 8e3718ac42..e383027d3e 100644
+index af6a5c743b..98e2436d1f 100644
More information about the stable
mailing list