Skip to contentSkip to conversation

FAILED: patch "[PATCH] tracing/osnoise: Call synchronize_rcu() when unregistering" failed to apply to 6.1-stable tree

PATCH New [email protected] 2 participants 3 messages Jul 21 – Jul 29

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x fe58f457ad8d0a2bef4e053cfecca4b5cd266b1a
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026072147-clang-iguana-51e4@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From fe58f457ad8d0a2bef4e053cfecca4b5cd266b1a Mon Sep 17 00:00:00 2001
From: Crystal Wood <[email protected]>
Date: Mon, 8 Jun 2026 23:54:30 -0500
Subject: [PATCH] tracing/osnoise: Call synchronize_rcu() when unregistering

This ensures that any RCU readers traversing the instance list have finished, before releasing the reference on the tracer that the instance points to.

kernel/trace/trace_osnoise.c +3 -1
index 5e83c4f6f2b4..0e1265acd1cc 100644
@@ -179,7 +179,9 @@ static void osnoise_unregister_instance(struct trace_array *tr)
 	if (!found)
 		return;
 
-	kvfree_rcu_mightsleep(inst);
+	/* Do a full sync to ensure that tr remains valid, not just inst */
+	synchronize_rcu();
+	kvfree(inst);
 }
 
 /*
maintainer
#1 lore raw

PATCH 1/2 tracing: Rename kvfree_rcu() to kvfree_rcu_mightsleep()

From: "Uladzislau Rezki (Sony)" <[email protected]>

[ Upstream commit cae16f2c2e11c60c888715f4d98c12740683d6a2 ]

The kvfree_rcu() macro's single-argument form is deprecated. Therefore switch to the new kvfree_rcu_mightsleep() variant. The goal is to avoid accidental use of the single-argument forms, which can introduce functionality bugs in atomic contexts and latency bugs in non-atomic contexts.

Stable-dep-of: fe58f457ad8d ("tracing/osnoise: Call synchronize_rcu() when unregistering")

---
 kernel/trace/trace_osnoise.c | 2 +-
 kernel/trace/trace_probe.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_osnoise.c +1 -1
index 676d9a3e65cde6..417b62f7550978 100644
@@ -137,7 +137,7 @@ static void osnoise_unregister_instance(struct trace_array *tr)
 	if (!found)
 		return;
 
-	kvfree_rcu(inst);
+	kvfree_rcu_mightsleep(inst);
 }
 
 /*
kernel/trace/trace_probe.c +1 -1
index 125111d310d1ba..241b7ba9a3a777 100644
@@ -1179,7 +1179,7 @@ int trace_probe_remove_file(struct trace_probe *tp,
 		return -ENOENT;
 
 	list_del_rcu(&link->list);
-	kvfree_rcu(link);
+	kvfree_rcu_mightsleep(link);
 
 	if (list_empty(&tp->event->files))
 		trace_probe_clear_flag(tp, TP_FLAG_TRACE);
Signature · 1 line
2.53.0
maintainer
#2 lore raw

PATCH 2/2 tracing/osnoise: Call synchronize_rcu() when unregistering

From: Crystal Wood <[email protected]>

[ Upstream commit fe58f457ad8d0a2bef4e053cfecca4b5cd266b1a ]

This ensures that any RCU readers traversing the instance list have finished, before releasing the reference on the tracer that the instance points to.

---
 kernel/trace/trace_osnoise.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/trace/trace_osnoise.c +3 -1
index 417b62f7550978..3b3f31ca45831b 100644
@@ -137,7 +137,9 @@ static void osnoise_unregister_instance(struct trace_array *tr)
 	if (!found)
 		return;
 
-	kvfree_rcu_mightsleep(inst);
+	/* Do a full sync to ensure that tr remains valid, not just inst */
+	synchronize_rcu();
+	kvfree(inst);
 }
 
 /*
Signature · 1 line
2.53.0