All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 3/5] bpf: infer zext_dst based on static register liveness analysis
Date: Sun, 02 Aug 2026 14:14:35 -0700	[thread overview]
Message-ID: <ddc2fbf63c32eb8b933589d27550f2a8d0eecba0.camel@gmail.com> (raw)
In-Reply-To: <20260802210741.D10C21F000E9@smtp.kernel.org>

On Sun, 2026-08-02 at 21:07 +0000, sashiko-bot@kernel.org wrote:

...

> > @@ -15026,18 +14941,14 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
> >  				if (insn->imm) {
> >  					/* off == BPF_ADDR_SPACE_CAST */
> >  					mark_reg_unknown(env, regs, insn->dst_reg);
> > -					if (insn->imm == 1) { /* cast from as(1) to as(0) */
> > +					if (insn->imm == 1) /* cast from as(1) to as(0) */
> >  						dst_reg->type = PTR_TO_ARENA;
> > -						/* PTR_TO_ARENA is 32-bit */
> > -						dst_reg->subreg_def = env->insn_idx + 1;
> > -					}
> 
> [Severity: Critical]
> Does this missing zero-extension for BPF_ADDR_SPACE_CAST allow out-of-bounds
> arena access on architectures needing explicit zero-extension?

Nope, in combination with changes to bpf_is_reg64() in the next patch
it does not. bpf_is_reg64() handles BPF_ADDR_SPACE_CAST after that change.
The commit log is not very clear about that, though.

...

  reply	other threads:[~2026-08-02 21:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 20:24 [PATCH bpf-next v3 0/5] bpf: infer zext_dst based on static register liveness analysis Eduard Zingerman
2026-08-02 20:24 ` [PATCH bpf-next v3 1/5] bpf: do not print a newline after disassembly in bpf_verbose_insn() Eduard Zingerman
2026-08-03  0:22   ` Quentin Monnet
2026-08-02 20:24 ` [PATCH bpf-next v3 2/5] bpf: track upper 32-bit register halves' liveness in compute_live_registers() Eduard Zingerman
2026-08-02 20:24 ` [PATCH bpf-next v3 3/5] bpf: infer zext_dst based on static register liveness analysis Eduard Zingerman
2026-08-02 21:07   ` sashiko-bot
2026-08-02 21:14     ` Eduard Zingerman [this message]
2026-08-02 20:24 ` [PATCH bpf-next v3 4/5] bpf: simplify the bpf_is_reg64() Eduard Zingerman
2026-08-02 21:26   ` sashiko-bot
2026-08-02 21:40     ` Eduard Zingerman
2026-08-02 20:24 ` [PATCH bpf-next v3 5/5] selftests/bpf: verify zext_dst annotations for various instructions 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=ddc2fbf63c32eb8b933589d27550f2a8d0eecba0.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.