mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL] probes: Fixes for for v7.0-rc3
@ 2026-03-15 11:32 Masami Hiramatsu
  2026-03-15 20:52 ` pr-tracker-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu @ 2026-03-15 11:32 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Masami Hiramatsu, Steven Rostedt, Masami Hiramatsu, linux-kernel

Hi Linus,

Probes fixes for v7.0-rc3

- kprobes: avoid crash when rmmod/insmod after ftrace killed
  This fixes a kernel crash caused by kprobes on the symbol in a
  module which is unloaded after ftrace_kill() is called.
- kprobes: Remove unneeded warnings from __arm_kprobe_ftrace()
  Remove unneeded WARN messages which can be kicked if the kprobe is
  using ftrace and it fails to enable the ftrace. Since kprobes
  correctly handle such failure, we don't need to warn it.


Please pull the latest probes-fixes-v7.0-rc3 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes-fixes-v7.0-rc3

Tag SHA1: fc4d86187c58bac3a67170db07dce1eb61a75a17
Head SHA1: 5ef268cb7a0aac55521fd9881f1939fa94a8988e


Masami Hiramatsu (Google) (2):
      kprobes: avoid crash when rmmod/insmod after ftrace killed
      kprobes: Remove unneeded warnings from __arm_kprobe_ftrace()

----
 kernel/kprobes.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---------------------------
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index ab25b4aa9095..bfc89083daa9 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1144,12 +1144,12 @@ static int __arm_kprobe_ftrace(struct kprobe *p, struct ftrace_ops *ops,
 	lockdep_assert_held(&kprobe_mutex);
 
 	ret = ftrace_set_filter_ip(ops, (unsigned long)p->addr, 0, 0);
-	if (WARN_ONCE(ret < 0, "Failed to arm kprobe-ftrace at %pS (error %d)\n", p->addr, ret))
+	if (ret < 0)
 		return ret;
 
 	if (*cnt == 0) {
 		ret = register_ftrace_function(ops);
-		if (WARN(ret < 0, "Failed to register kprobe-ftrace (error %d)\n", ret)) {
+		if (ret < 0) {
 			/*
 			 * At this point, sinec ops is not registered, we should be sefe from
 			 * registering empty filter.
@@ -1178,6 +1178,10 @@ static int __disarm_kprobe_ftrace(struct kprobe *p, struct ftrace_ops *ops,
 	int ret;
 
 	lockdep_assert_held(&kprobe_mutex);
+	if (unlikely(kprobe_ftrace_disabled)) {
+		/* Now ftrace is disabled forever, disarm is already done. */
+		return 0;
+	}
 
 	if (*cnt == 1) {
 		ret = unregister_ftrace_function(ops);

-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] probes: Fixes for for v7.0-rc3
  2026-03-15 11:32 [GIT PULL] probes: Fixes for for v7.0-rc3 Masami Hiramatsu
@ 2026-03-15 20:52 ` pr-tracker-bot
  0 siblings, 0 replies; 2+ messages in thread
From: pr-tracker-bot @ 2026-03-15 20:52 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Linus Torvalds, Masami Hiramatsu (Google),
	Steven Rostedt, Masami Hiramatsu, linux-kernel

The pull request you sent on Sun, 15 Mar 2026 20:32:12 +0900:

> git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git probes-fixes-v7.0-rc3

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/d9bf296c398d093f9641568411dee16285302113

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-15 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-15 11:32 [GIT PULL] probes: Fixes for for v7.0-rc3 Masami Hiramatsu
2026-03-15 20:52 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®