patch 'net/mlx5: fix use-after-free in ASO management init' has been queued to stable release 24.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Mar 19 23:02:13 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/21/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/8687313759ba9b17375610fd8d316651d1f36ec1
Thanks.
Luca Boccassi
---
>From 8687313759ba9b17375610fd8d316651d1f36ec1 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 17 Feb 2026 07:05:01 -0800
Subject: [PATCH] net/mlx5: fix use-after-free in ASO management init
[ upstream commit 07d527b2e268599a80b7464866856bbf45fd07bc ]
mlx5_flow_aso_age_mng_init() and mlx5_flow_aso_ct_mng_init() each
allocate a management structure, then call mlx5_aso_queue_init().
If the queue init fails, the structure is freed but the pointer in
the shared context (sh->aso_age_mng / sh->ct_mng) is not set to
NULL.
A subsequent call to the same init function sees the non-NULL
pointer, skips re-allocation, and returns success, leaving the
caller operating on freed memory.
Set the pointer to NULL after freeing in both error paths.
Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 345ff12718..5cd5cafb1b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -453,6 +453,7 @@ mlx5_flow_aso_age_mng_init(struct mlx5_dev_ctx_shared *sh)
err = mlx5_aso_queue_init(sh, ASO_OPC_MOD_FLOW_HIT, 1);
if (err) {
mlx5_free(sh->aso_age_mng);
+ sh->aso_age_mng = NULL;
return -1;
}
rte_rwlock_init(&sh->aso_age_mng->resize_rwl);
@@ -817,6 +818,7 @@ mlx5_flow_aso_ct_mng_init(struct mlx5_dev_ctx_shared *sh)
err = mlx5_aso_queue_init(sh, ASO_OPC_MOD_CONNECTION_TRACKING, MLX5_ASO_CT_SQ_NUM);
if (err) {
mlx5_free(sh->ct_mng);
+ sh->ct_mng = NULL;
/* rte_errno should be extracted from the failure. */
rte_errno = EINVAL;
return -rte_errno;
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-19 22:00:48.592456080 +0000
+++ 0021-net-mlx5-fix-use-after-free-in-ASO-management-init.patch 2026-03-19 22:00:47.798359367 +0000
@@ -1 +1 @@
-From 07d527b2e268599a80b7464866856bbf45fd07bc Mon Sep 17 00:00:00 2001
+From 8687313759ba9b17375610fd8d316651d1f36ec1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 07d527b2e268599a80b7464866856bbf45fd07bc ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index d533ce41e1..71383f2ac7 100644
+index 345ff12718..5cd5cafb1b 100644
@@ -31 +32 @@
-@@ -459,6 +459,7 @@ mlx5_flow_aso_age_mng_init(struct mlx5_dev_ctx_shared *sh)
+@@ -453,6 +453,7 @@ mlx5_flow_aso_age_mng_init(struct mlx5_dev_ctx_shared *sh)
@@ -39 +40 @@
-@@ -823,6 +824,7 @@ mlx5_flow_aso_ct_mng_init(struct mlx5_dev_ctx_shared *sh)
+@@ -817,6 +818,7 @@ mlx5_flow_aso_ct_mng_init(struct mlx5_dev_ctx_shared *sh)
More information about the stable
mailing list