On Thu, 21 May 2026 22:50:33 -0400
Steven Rostedt <[email protected]> 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) <[email protected]>

Reply via email to