[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250510065528.d726869719f27145cc69f179@kernel.org>
Date: Sat, 10 May 2025 06:55:28 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: Matthieu Baerts <matttbe@...nel.org>
Cc: Breno Leitao <leitao@...ian.org>, Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
kernel-team@...a.com
Subject: Re: [PATCH] tracing: fprobe: Fix RCU warning message in list
traversal
On Fri, 9 May 2025 16:30:08 +0200
Matthieu Baerts <matttbe@...nel.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@...nel.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@...nel.org>
Powered by blists - more mailing lists