Re: [PATCH v6] tracing/eprobes: Allow use of BTF names to dereference pointers
From: Google
Date: Fri May 29 2026 - 00:25:36 EST
On Thu, 21 May 2026 22:50:33 -0400
Steven Rostedt <rostedt@xxxxxxxxxx> 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@xxxxxxxxxx>