Re: [PATCH bpf-next v2 1/3] bpf: add missing fsession to the verifier log

From: Alexei Starovoitov

Date: Wed Apr 08 2026 - 12:04:56 EST


On Wed, Apr 8, 2026 at 6:21 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
>
> On Wed, Apr 08, 2026 at 02:21:07PM +0800, Menglong Dong wrote:
> > The fsession attach type is missed in the verifier log in
> > check_get_func_ip(), bpf_check_attach_target() and check_attach_btf_id().
> > Update them to make the verifier log proper. Meanwhile, update the
> > corresponding selftests.
> >
> > Signed-off-by: Menglong Dong <dongml2@xxxxxxxxxxxxxxx>
> > Acked-by: Leon Hwang <leon.hwang@xxxxxxxxx>
> > ---
> > v2:
> > - add a missing FSESSION in bpf_check_attach_target()
> > ---
> > kernel/bpf/verifier.c | 10 +++++-----
> > tools/testing/selftests/bpf/prog_tests/exceptions.c | 8 ++++----
> > tools/testing/selftests/bpf/verifier/sleepable.c | 2 +-
> > 3 files changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index 594260c1f382..beb660b4c3ec 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -11757,7 +11757,7 @@ static int check_get_func_ip(struct bpf_verifier_env *env)
> >
> > if (type == BPF_PROG_TYPE_TRACING) {
> > if (!bpf_prog_has_trampoline(env->prog)) {
> > - verbose(env, "func %s#%d supported only for fentry/fexit/fmod_ret programs\n",
> > + verbose(env, "func %s#%d supported only for fentry/fexit/fsession/fmod_ret programs\n",
> > func_id_name(func_id), func_id);
> > return -ENOTSUPP;
> > }
> > @@ -25561,7 +25561,7 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,
> > btf = tgt_prog ? tgt_prog->aux->btf : prog->aux->attach_btf;
> > if (!btf) {
> > bpf_log(log,
> > - "FENTRY/FEXIT program can only be attached to another program annotated with BTF\n");
> > + "FENTRY/FEXIT/FSESSION program can only be attached to another program annotated with BTF\n");
>
> I wonder this should say 'Tracing program...' instead,
> we have other tracing types not covered in this error

+1

pw-bot: cr