From: Eduard Zingerman <eddyz87@gmail.com>
To: bot+bpf-ci@kernel.org, bpf@vger.kernel.org, ast@kernel.org,
andrii@kernel.org
Cc: daniel@iogearbox.net, martin.lau@linux.dev, kernel-team@fb.com,
yonghong.song@linux.dev, martin.lau@kernel.org, clm@meta.com,
ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next 10/14] bpf: change logging scheme for live stack analysis
Date: Thu, 09 Apr 2026 16:34:20 -0700 [thread overview]
Message-ID: <5862e2cda1c76e71be03a4cb4bdf6a95e3994f8f.camel@gmail.com> (raw)
In-Reply-To: <e95d13fbead722599e4564be81702065da89034039d3dffa005eadb41b5f9382@mail.kernel.org>
On Thu, 2026-04-09 at 02:14 +0000, bot+bpf-ci@kernel.org wrote:
> > diff --git a/kernel/bpf/liveness.c b/kernel/bpf/liveness.c
> > index c3098369bee8..832c10846ec5 100644
> > --- a/kernel/bpf/liveness.c
> > +++ b/kernel/bpf/liveness.c
>
> [ ... ]
>
> > +static void print_instance(struct bpf_verifier_env *env, struct func_instance *instance)
> > +{
> > + int start = env->subprog_info[instance->subprog].start;
> > + struct bpf_insn *insns = env->prog->insnsi;
> > + struct per_frame_masks *masks;
> > + int insn_idx, frame, pos, insn_pos, i;
> > + int len = instance->insn_cnt;
> > + bool has_use, has_def;
> > +
> > + if (!(env->log.level & BPF_LOG_LEVEL2))
> > + return;
> > +
> > + verbose(env, "stack use/def %s ", fmt_subprog(env, instance->subprog));
> > + verbose(env, "%s:\n", fmt_instance(env, instance));
> > + fmt_instance(env, instance);
>
> Is this bare fmt_instance() call intended? Its return value is
> discarded and the tmp_str_buf it writes into is overwritten by
> later fmt_spis_mask() calls in the loop below, so the call appears
> to have no effect.
Should be removed.
>
> > + for (i = 0; i < len; i++) {
>
> [ ... ]
>
> > @@ -1805,6 +1896,9 @@ int bpf_compute_subprog_arg_access(struct bpf_verifier_env *env)
> > break;
> > }
> > +
> > + if (env->log.level & BPF_LOG_LEVEL2)
> > + err = print_instances(env);
> > +
> > out:
>
> If the for-loop above breaks out with a non-zero err (e.g. from
> analyze_subprog() returning -ENOMEM) and BPF_LOG_LEVEL2 is set,
> this overwrites err with the return value of print_instances().
Should not be clobbered.
next prev parent reply other threads:[~2026-04-09 23:34 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 1:33 [PATCH bpf-next 00/14] bpf: static stack liveness data flow analysis Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 01/14] bpf: share several utility functions as internal API Eduard Zingerman
2026-04-09 17:00 ` Mykyta Yatsenko
2026-04-09 1:33 ` [PATCH bpf-next 02/14] bpf: save subprogram name in bpf_subprog_info Eduard Zingerman
2026-04-09 2:14 ` bot+bpf-ci
2026-04-09 21:55 ` Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 03/14] bpf: Add spis_*() helpers for 4-byte stack slot bitmasks Eduard Zingerman
2026-04-09 3:12 ` bot+bpf-ci
2026-04-09 22:05 ` Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 04/14] bpf: make liveness.c track stack with 4-byte granularity Eduard Zingerman
2026-04-09 2:26 ` bot+bpf-ci
2026-04-09 23:21 ` Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 05/14] bpf: 4-byte precise clean_verifier_state Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 06/14] bpf: prepare bpf_liveness api for use by static analysis pass Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 07/14] bpf: introduce forward arg-tracking dataflow analysis Eduard Zingerman
2026-04-09 2:26 ` bot+bpf-ci
2026-04-09 23:28 ` Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 08/14] bpf: record arg tracking results in bpf_liveness masks Eduard Zingerman
2026-04-09 2:26 ` bot+bpf-ci
2026-04-09 23:32 ` Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 09/14] bpf: simplify liveness to use (callsite, depth) keyed func_instances Eduard Zingerman
2026-04-09 2:26 ` bot+bpf-ci
2026-04-09 1:33 ` [PATCH bpf-next 10/14] bpf: change logging scheme for live stack analysis Eduard Zingerman
2026-04-09 2:14 ` bot+bpf-ci
2026-04-09 23:34 ` Eduard Zingerman [this message]
2026-04-09 1:33 ` [PATCH bpf-next 11/14] selftests/bpf: update existing tests due to liveness changes Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 12/14] selftests/bpf: adjust verifier_log buffers Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 13/14] selftests/bpf: add new tests for static stack liveness analysis Eduard Zingerman
2026-04-09 1:33 ` [PATCH bpf-next 14/14] bpf: poison dead stack slots Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5862e2cda1c76e71be03a4cb4bdf6a95e3994f8f.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=ihor.solodrai@linux.dev \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox