Re: [PATCH bpf-next v3 09/13] bpf: change logging scheme for live stack analysis

Eduard Zingerman
2026-04-10T17:12:11Z

On Fri, 2026-04-10 at 09:57 +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
> > index 1d9c89a269e3..3c421ad8684c 100644
> > --- a/kernel/bpf/liveness.c
> > +++ b/kernel/bpf/liveness.c
>
> [ ... ]
>
> > +static char *fmt_subprog(struct bpf_verifier_env *env, int subprog)
> > +{
> > + const char *name = env->subprog_info[subprog].name;
> > +
> > + snprintf(env->tmp_str_buf, sizeof(env->tmp_str_buf),
> > + "subprog#%d%s%s", subprog, name ? " " : "", name ?: NULL);
> > + return env->tmp_str_buf;
> > +}
>
> Should `name ?: NULL` be `name ?: ""`? When subprog_info[].name is
> NULL (programs loaded without BTF func info), this passes NULL to the
> third %s. The kernel's vsnprintf prints "(null)", so the output
> becomes "subprog#0(null)" instead of "subprog#0".
>
> The conditional `name ? " " : ""` on the second %s shows the intent
> to suppress the name entirely when absent, but the NULL on the third
> %s defeats that.

Uh-oh.
Silly meatbag is going to be obsolete soon.

>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/24236538770