From: Nathan Chancellor <nathan@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Peter Zijlstra <peterz@infradead.org>,
Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Subject: Re: [GIT PULL] tracing: Fixes for 7.1
Date: Fri, 5 Jun 2026 08:58:04 -0700 [thread overview]
Message-ID: <20260605155804.GA3472545@ax162> (raw)
In-Reply-To: <20260604084755.4d94063e@fedora>
On Thu, Jun 04, 2026 at 08:47:55AM -0400, Steven Rostedt wrote:
> commit 0652a3daa78723f955b1ebeb621665ce72bec53e
> Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
> Date: Wed Jun 3 18:31:42 2026 +0300
>
> tracing: Fix CFI violation in probestub being called by tprobes
>
> The probestub is a function to allow tprobes to hook to a tracepoint to
> gain access to its parameters. The function itself is only referenced by
> the tracepoint structure which lives in the __tracepoint section. objtool
> explicitly ignores that section and when processing functions in the
> kernel, if it detects one that has no references it will seal it to have
> its ENDBR stripped on boot up.
>
> This means when a tprobe is attached to the sched_wakeup tracepoint, when it
> is triggered it will call __probestub_sched_wakeup and due to the missing
> ENDBR on a CFI-enabled machine it will take a #CP exception.
>
> Fix this by adding CFI_NOSEAL annotation to probestub declaration.
>
> Cc: stable@vger.kernel.org
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> Link: https://patch.msgid.link/20260603153147.573589-1-eva.kurchatova@virtuozzo.com
> Fixes: d5173f753750 ("objtool: Exclude __tracepoints data from ENDBR checks")
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
> [ Updated change log ]
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>
> diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> index 763eea4d80d8..2d2b9f8cdda4 100644
> --- a/include/linux/tracepoint.h
> +++ b/include/linux/tracepoint.h
> @@ -20,6 +20,7 @@
> #include <linux/rcupdate_trace.h>
> #include <linux/tracepoint-defs.h>
> #include <linux/static_call.h>
> +#include <linux/cfi.h>
>
> struct module;
> struct tracepoint;
> @@ -389,6 +390,13 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p)
> void __probestub_##_name(void *__data, proto) \
> { \
> } \
> + /* \
> + * Annotate the probestub 'CFI_NOSEAL' to stop objtool from \
> + * requesting the kernel remove the ENDBR, because the only \
> + * references to the function are in the __tracepoint section, \
> + * that objtool doesn't scan. \
> + */ \
> + CFI_NOSEAL(__probestub_##_name); \
> DEFINE_STATIC_CALL(tp_func_##_name, __traceiter_##_name); \
> DEFINE_RUST_DO_TRACE(_name, TP_PROTO(proto), TP_ARGS(args))
>
This needs a build fix, as ARCH=arm allmodconfig is now broken with
Clang.
https://lore.kernel.org/20260604-tracing-fix-cfi-h-build-error-v1-1-b27015390901@kernel.org/
--
Cheers,
Nathan
next prev parent reply other threads:[~2026-06-05 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 12:47 Steven Rostedt
2026-06-04 22:12 ` pr-tracker-bot
2026-06-05 15:58 ` Nathan Chancellor [this message]
2026-06-06 21:58 ` Nathan Chancellor
2026-06-06 22:09 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2026-05-21 22:08 Steven Rostedt
2026-05-22 14:26 ` pr-tracker-bot
2026-05-17 13:17 Steven Rostedt
2026-05-17 19:28 ` pr-tracker-bot
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=20260605155804.GA3472545@ax162 \
--to=nathan@kernel.org \
--cc=eva.kurchatova@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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
Powered by JetHome