Re: [PATCH bpf v2 1/2] bpf: Fix tracing of kfuncs with implicit args

From: Jiri Olsa

Date: Mon Jul 13 2026 - 08:51:17 EST


On Fri, Jul 10, 2026 at 12:29:39PM -0700, Ihor Solodrai wrote:

SNIP

> +
> int bpf_check_attach_target(struct bpf_verifier_log *log,
> const struct bpf_prog *prog,
> const struct bpf_prog *tgt_prog,
> @@ -19121,8 +19159,8 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,
> if (prog_extension &&
> btf_check_type_match(log, prog, btf, t))
> return -EINVAL;
> - t = btf_type_by_id(btf, t->type);
> - if (!btf_type_is_func_proto(t))
> + t = btf_attach_func_proto(log, btf, btf_id);
> + if (!t || !btf_type_is_func_proto(t))
> return -EINVAL;
>
> if ((prog->aux->saved_dst_prog_type || prog->aux->saved_dst_attach_type) &&
> @@ -19407,8 +19445,8 @@ int bpf_check_attach_btf_id_multi(struct btf *btf, struct bpf_prog *prog, u32 bt
> return -EINVAL;
> if (!btf_type_is_func(t))
> return -EINVAL;

the btf_type_is_func check is now part of btf_attach_func_proto,
so I think we can remove this one

jirka

> - t = btf_type_by_id(btf, t->type);
> - if (!btf_type_is_func_proto(t))
> + t = btf_attach_func_proto(NULL, btf, btf_id);
> + if (!t || !btf_type_is_func_proto(t))
> return -EINVAL;
> err = btf_distill_func_proto(NULL, btf, t, tname, &tgt_info->fmodel);
> if (err < 0)
> --
> 2.55.0
>
>