From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Sechang Lim" <rhkrqnwk98@gmail.com>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>
Cc: "John Fastabend" <john.fastabend@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>,
"Bradley Morgan" <bradley.morgan@linux.dev>,
"Paul E. McKenney" <paulmck@kernel.org>,
"Frederic Weisbecker" <frederic@kernel.org>,
"Neeraj Upadhyay" <neeraj.upadhyay@kernel.org>,
"Joel Fernandes" <joelagnelf@nvidia.com>,
"Josh Triplett" <josh@joshtriplett.org>,
"Boqun Feng" <boqun@kernel.org>,
"Uladzislau Rezki" <urezki@gmail.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Lai Jiangshan" <jiangshanlai@gmail.com>,
"Zqiang" <qiang.zhang@linux.dev>, <rcu@vger.kernel.org>,
<bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2] bpf: Add rcu_read_unlock_special() into btf id deny list
Date: Wed, 25 Nov 2026 04:44:48 +0000 [thread overview]
Message-ID: <DN40NNXNVB6R.263I8UYD7B329@gmail.com> (raw)
In-Reply-To: <20261125040106.2200628-1-rhkrqnwk98@gmail.com>
On Tue, Nov 24, 2026 at 08:01 PM Sechang Lim <rhkrqnwk98@gmail.com> wrote:
> BTF_ID(func, __rcu_read_lock)
> BTF_ID(func, __rcu_read_unlock)
> +BTF_ID(func, rcu_read_unlock_special)
This will break gcc builds with KASAN and WERROR.
It was my suggestion, sorry.
The other entries are global functions. This one is static and has
one caller, so gcc inlines it in KASAN builds.
The splat in commit 684c68d92e2e has no such frame:
rcu_preempt_deferred_qs_irqrestore+0x74/0xed0
__rcu_read_unlock+0x290/0x3b0
On x86 __rcu_read_unlock() is 0x2f0 bytes in commit caf3ef7468f7
and 0x120 bytes in your log.
Without a symbol there is no FUNC in BTF, and id_patch() prints:
WARN: resolve_btfids: unresolved symbol rcu_read_unlock_special
WERROR makes it fatal. Sasha fixed such breaks last month:
https://lore.kernel.org/bpf/20261019211006.2574350-1-sashal@kernel.org/
rcu_unlock_needs_exp_handling() also runs with .s set and no guard.
fentry on an out-of-line copy recurses the same way.
It's normally inlined, so it cannot go into btf_id_deny.
Plain inline is not enough. Song's series drops notrace from it:
https://lore.kernel.org/bpf/20261023011049.1164625-1-song@kernel.org/
Two attributes in tree_plugin.h on top of your patch cover both.
clang builds tree.o with them. I didn't try gcc, the BTF step or a boot.
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index ae5d21b..5f2f56c 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -689,7 +689,7 @@ static void rcu_preempt_deferred_qs_handler(struct irq_work *iwp)
*
* Returns true if expedited processing of the rcu_read_unlock() is needed.
*/
-static bool rcu_unlock_needs_exp_handling(struct task_struct *t,
+static __always_inline bool rcu_unlock_needs_exp_handling(struct task_struct *t,
struct rcu_data *rdp,
struct rcu_node *rnp,
bool irqs_were_disabled)
@@ -745,8 +745,10 @@ static bool rcu_unlock_needs_exp_handling(struct task_struct *t,
* Handle special cases during rcu_read_unlock(), such as needing to
* notify RCU core processing or task having blocked during the RCU
* read-side critical section.
+ *
+ * noinline: btf_id_deny in kernel/bpf/verifier.c needs it in BTF.
*/
-static void rcu_read_unlock_special(struct task_struct *t)
+static noinline void rcu_read_unlock_special(struct task_struct *t)
{
unsigned long flags;
bool irqs_were_disabled;
Pls fold it in and build with gcc and KASAN.
Please cc Paul and rcu folks on a respin.
pw-bot: cr
prev parent reply other threads:[~2026-11-25 4:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 4:01 [PATCH bpf-next v2] bpf: Add rcu_read_unlock_special() into btf id deny list Sechang Lim
2026-11-25 4:23 ` sashiko-bot
2026-11-25 4:44 ` Alexei Starovoitov [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=DN40NNXNVB6R.263I8UYD7B329@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=boqun@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=bradley.morgan@linux.dev \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=frederic@kernel.org \
--cc=ihor.solodrai@linux.dev \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=josh@joshtriplett.org \
--cc=martin.lau@linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=memxor@gmail.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rhkrqnwk98@gmail.com \
--cc=rostedt@goodmis.org \
--cc=song@kernel.org \
--cc=urezki@gmail.com \
--cc=yonghong.song@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