patch 'eal/freebsd: unregister alarm callback before free' has been queued to stable release 24.11.3
Kevin Traynor
ktraynor at redhat.com
Fri Jul 18 21:30:23 CEST 2025
Hi,
FYI, your patch has been queued to stable release 24.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/23/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/0fce285ecb5e64805f02ff05c11ede111eb90816
Thanks.
Kevin
---
>From 0fce285ecb5e64805f02ff05c11ede111eb90816 Mon Sep 17 00:00:00 2001
From: Rui Ferreira <rui.ferreira1 at h-partners.com>
Date: Fri, 30 May 2025 09:18:44 +0100
Subject: [PATCH] eal/freebsd: unregister alarm callback before free
[ upstream commit cf1937a96dcf63f6e00e3181654a845edb1fd682 ]
Unregister callback on cleanup to avoid use after free from the
interrupt thread (eal_intr_thread_main).
To be more defensive, set ptr to NULL if we can unregister.
rte_intr_callback_unregister_sync may (optionally) use traces
so the alarm cleanup must happen before eal_trace_fini to avoid
accessing freed memory.
Bugzilla ID: 1683
Fixes: 90b13ab8d4f7 ("alarm: remove direct access to interrupt handle")
Signed-off-by: Rui Ferreira <rui.ferreira1 at h-partners.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
lib/eal/freebsd/eal.c | 2 +-
lib/eal/freebsd/eal_alarm.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index d07cff8651..2cb693a90b 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -902,7 +902,7 @@ rte_eal_cleanup(void)
rte_mp_channel_cleanup();
eal_bus_cleanup();
+ rte_eal_alarm_cleanup();
rte_trace_save();
eal_trace_fini();
- rte_eal_alarm_cleanup();
/* after this point, any DPDK pointers will become dangling */
rte_eal_memory_detach();
diff --git a/lib/eal/freebsd/eal_alarm.c b/lib/eal/freebsd/eal_alarm.c
index 3680f5caba..65e8a4eb6b 100644
--- a/lib/eal/freebsd/eal_alarm.c
+++ b/lib/eal/freebsd/eal_alarm.c
@@ -50,5 +50,11 @@ void
rte_eal_alarm_cleanup(void)
{
- rte_intr_instance_free(intr_handle);
+ /* unregister callback using intr_handle in interrupt thread */
+ int ret = rte_intr_callback_unregister_sync(intr_handle,
+ eal_alarm_callback, (void *)-1);
+ if (ret >= 0) {
+ rte_intr_instance_free(intr_handle);
+ intr_handle = NULL;
+ }
}
--
2.50.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-07-18 20:29:14.102706320 +0100
+++ 0089-eal-freebsd-unregister-alarm-callback-before-free.patch 2025-07-18 20:29:10.995907530 +0100
@@ -1 +1 @@
-From cf1937a96dcf63f6e00e3181654a845edb1fd682 Mon Sep 17 00:00:00 2001
+From 0fce285ecb5e64805f02ff05c11ede111eb90816 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit cf1937a96dcf63f6e00e3181654a845edb1fd682 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index d6fffa2170..45adfad668 100644
+index d07cff8651..2cb693a90b 100644
@@ -31 +32 @@
-@@ -907,7 +907,7 @@ rte_eal_cleanup(void)
+@@ -902,7 +902,7 @@ rte_eal_cleanup(void)
@@ -41 +42 @@
-index 28f285fdef..c03e281e67 100644
+index 3680f5caba..65e8a4eb6b 100644
@@ -44 +45 @@
-@@ -51,5 +51,11 @@ void
+@@ -50,5 +50,11 @@ void
More information about the stable
mailing list