Linux Trace Kernel
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, sashiko-bot@kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] fprobe: Protect fprobe_return() with guard(rcu)()
Date: Tue, 29 Sep 2026 15:39:06 -0400	[thread overview]
Message-ID: <20260929153906.6b1f9c29@fedora> (raw)
In-Reply-To: <20260928212251.58fa1f68f33d4c967a8e8b1c@kernel.org>

On Mon, 28 Sep 2026 21:22:51 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

> 
> Hm, OK. Maybe we need to add something like checking rcu_watching, but
> FTRACE_OPS_FL_RCU does not work correctly because fgraph_init_ops() only
> configures subops (gops->ops). ftrace_startup_subops() does not propagete
> that flag to graph_ops. (I guess that is yet another problem?)
> 
> To guarantee no illegal RCU usage or lockdep splats if an instrumented
> function returns while RCU is offline, we can check 
> 
>  if (unlikely(!rcu_is_watching()))
> 	return;

If rcu isn't watching then that is a bug.

If you enable CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING then the
ftrace_test_recursion_trylock() tests for rcu_is_watching(). We
actually had that as default for some time to trigger any ftrace calls
that were outside of RCU watching and was fixed.

Perhaps we need to enable that on more test machines to see if anything
came back and allowed ftrace to trigger without it watching?

-- Steve

  reply	other threads:[~2026-09-29 19:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  0:35 [PATCH] fprobe: Protect fprobe_return() with guard(rcu)() Masami Hiramatsu (Google)
2026-09-28  0:35 ` Masami Hiramatsu (Google)
2026-09-28  0:51   ` sashiko-bot
2026-09-28 12:22     ` Masami Hiramatsu
2026-09-29 19:39       ` Steven Rostedt [this message]
2026-09-29 23:30         ` Masami Hiramatsu
2026-09-28 16:10   ` Paul E. McKenney
2026-09-29  0:13     ` Masami Hiramatsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260929153906.6b1f9c29@fedora \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox