The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Matthieu Baerts <matttbe@kernel.org>
Cc: Breno Leitao <leitao@debian.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	kernel-team@meta.com
Subject: Re: [PATCH] tracing: fprobe: Fix RCU warning message in list traversal
Date: Sat, 10 May 2025 06:55:28 +0900	[thread overview]
Message-ID: <20250510065528.d726869719f27145cc69f179@kernel.org> (raw)
In-Reply-To: <bdc3a680-d915-4b84-9d87-bfbe68372243@kernel.org>

On Fri, 9 May 2025 16:30:08 +0200
Matthieu Baerts <matttbe@kernel.org> wrote:

> Hi Breno,
> 
> On 10/04/2025 14:22, Breno Leitao wrote:
> > When CONFIG_PROVE_RCU_LIST is enabled, fprobe triggers the following
> > warning:
> > 
> >     WARNING: suspicious RCU usage
> >     kernel/trace/fprobe.c:457 RCU-list traversed in non-reader section!!
> > 
> >     other info that might help us debug this:
> > 	#1: ffffffff863c4e08 (fprobe_mutex){+.+.}-{4:4}, at: fprobe_module_callback+0x7b/0x8c0
> > 
> >     Call Trace:
> > 	fprobe_module_callback
> > 	notifier_call_chain
> > 	blocking_notifier_call_chain
> > 
> > This warning occurs because fprobe_remove_node_in_module() traverses an
> > RCU list using RCU primitives without holding an RCU read lock. However,
> > the function is only called from fprobe_module_callback(), which holds
> > the fprobe_mutex lock that provides sufficient protection for safely
> > traversing the list.
> > 
> > Fix the warning by specifying the locking design to the
> > CONFIG_PROVE_RCU_LIST mechanism. Add the lockdep_is_held() argument to
> > hlist_for_each_entry_rcu() to inform the RCU checker that fprobe_mutex
> > provides the required protection.
> 
> @Breno: thank you for the patch, I have it applied for a while on a
> branch dedicated to our CI to avoid false positive reports.
> 
> Tested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Oops, I missed this patch.

Let me pick it up and send it urgently.

Thank you,

> 
> 
> Hopefully this fix can be sent to Linus before the v6.15 release :)
> 
> Cheers,
> Matt
> -- 
> Sponsored by the NGI0 Core fund.
> 


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

      reply	other threads:[~2025-05-09 21:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 12:22 [PATCH] tracing: fprobe: Fix RCU warning message in list traversal Breno Leitao
2025-04-15  7:42 ` Antonio Quartulli
2025-05-09 14:30 ` Matthieu Baerts
2025-05-09 21:55   ` Masami Hiramatsu [this message]

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=20250510065528.d726869719f27145cc69f179@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=matttbe@kernel.org \
    --cc=rostedt@goodmis.org \
    /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