BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	bpf@vger.kernel.org,  andrii@kernel.org
Cc: daniel@iogearbox.net, kernel-team@fb.com,
	yonghong.song@linux.dev,  memxor@gmail.com
Subject: Re: [PATCH bpf-next v2 1/2] bpf: reject pointer operands for 32-bit recurrences/latches
Date: Thu, 22 Oct 2026 18:04:11 -0700	[thread overview]
Message-ID: <a7b9422e00b9a3f5438e996f01e97bef476040e0.camel@gmail.com> (raw)
In-Reply-To: <fefe4448c7a9f9938c78f1597dd20fa96f180002.camel@gmail.com>

On Wed, 2026-10-21 at 15:50 -0700, Eduard Zingerman wrote:
> On Wed, 2026-10-21 at 22:22 +0000, Alexei Starovoitov wrote:
> > On Wed, Oct 21, 2026 at 11:56 AM Eduard Zingerman <eddyz87@gmail.com> wrote:

...

> > le64 does the same without zext32.
> > 
> >      r7 = map_value, r1 = 0
> >   l: r7 = le64 r7
> >      if r7 < 100 goto out
> >      if r7 > 1000 goto out
> >      r7 += 8
> >      r1 += 1
> >      if r1 != 4 goto l
> > 
> > On little endian transfer() treats le64 as a nop, so r7 at the header
> > is (linear r7 8), while check_alu_op() makes it an unknown scalar.
> > At the backedge r7 is a scalar 108..1008 and bpf_clamp_scev_regs()
> > intersects it with 0..24, the offsets of map_value at the loop entry:
> >   verifier bug: scev clamp produced empty range for r7

Actually, I don't think there is anything to fix:
- check_alu_op() errors out if le64 is applied to a pointer.
- (linear r7 8) means that every path over the loop body
  is guaranteed to construct the linear equation.

Meaning that le64 would remain visible to the main verification pass
and would be rejected.

I'll re-spin these two patches as a part of bigger series with a
correct fixes tag but otherwise unchanged.

      reply	other threads:[~2026-10-23  1:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 18:56 [PATCH bpf-next v2 1/2] bpf: reject pointer operands for 32-bit recurrences/latches Eduard Zingerman
2026-10-21 18:56 ` [PATCH bpf-next v2 2/2] selftests/bpf: " Eduard Zingerman
2026-10-21 18:57 ` [PATCH bpf-next v2 1/2] bpf: reject " Eduard Zingerman
2026-10-21 22:22 ` Alexei Starovoitov
2026-10-21 22:50   ` Eduard Zingerman
2026-10-23  1:04     ` Eduard Zingerman [this message]

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=a7b9422e00b9a3f5438e996f01e97bef476040e0.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=memxor@gmail.com \
    --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