From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux trace kernel <linux-trace-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Mark Rutland <mark.rutland@arm.com>,
Peter Zijlstra <peterz@infradead.org>,
Namhyung Kim <namhyung@kernel.org>,
Takaya Saeki <takayas@google.com>,
Douglas Raillard <douglas.raillard@arm.com>,
Tom Zanussi <zanussi@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ian Rogers <irogers@google.com>, Jiri Olsa <olsajiri@gmail.com>
Subject: Re: [PATCH v6] tracing/eprobes: Allow use of BTF names to dereference pointers
Date: Fri, 29 May 2026 13:25:08 +0900 [thread overview]
Message-ID: <20260529132508.2e98cab925fdb1fa7be21a9b@kernel.org> (raw)
In-Reply-To: <20260521225033.56458336@fedora>
On Thu, 21 May 2026 22:50:33 -0400
Steven Rostedt <rostedt@kernel.org> wrote:
> + if (ctx->flags & TPARG_FL_TEVENT) {
> + int ret;
> +
> + ret = parse_trace_event(varname, code, ctx);
> + if (ret < 0)
> + return ret;
> +
> + if (ctx->flags & TPARG_FL_TYPECAST) {
> + type = ctx->last_struct;
> + goto found_type;
> + }
> + return 0;
Here is a bit complicated but a buggy case.
parse_btf_arg() is not used for eprobe arguments because those
requires '$' prefix. However, only if it has a typecast, this
parse_btf_arg() is called for eprobes.
Thus, we should report a kernel bug if !ctx->flags & TPARG_FL_TYPECAST
here. Something like this:
if (WARN_ONCE(!(ctx->flags & TPARG_FL_TYPECAST)))
return -EINVAL;
type = ctx->last_struct;
goto found_type;
Thanks,
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2026-05-29 4:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 2:50 [PATCH v6] tracing/eprobes: Allow use of BTF names to dereference pointers Steven Rostedt
2026-05-22 11:23 ` Steven Rostedt
2026-05-22 14:45 ` Steven Rostedt
2026-05-24 10:15 ` Masami Hiramatsu
2026-05-25 14:55 ` Masami Hiramatsu
2026-05-26 15:33 ` Steven Rostedt
2026-05-26 0:09 ` Masami Hiramatsu
2026-05-26 15:33 ` Steven Rostedt
2026-05-27 8:59 ` Jiri Olsa
2026-05-27 14:08 ` Steven Rostedt
2026-05-27 14:16 ` Steven Rostedt
2026-05-29 4:25 ` Masami Hiramatsu [this message]
2026-05-29 13:19 ` Steven Rostedt
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=20260529132508.2e98cab925fdb1fa7be21a9b@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=douglas.raillard@arm.com \
--cc=irogers@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=namhyung@kernel.org \
--cc=olsajiri@gmail.com \
--cc=peterz@infradead.org \
--cc=rostedt@kernel.org \
--cc=takayas@google.com \
--cc=tglx@linutronix.de \
--cc=zanussi@kernel.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