Re: [RFC PATCH 6.1.y 0/2] bpf: backport scalar not-equal tracking fixes
From: Zhenzhong Wu
Date: Tue Jun 02 2026 - 13:26:52 EST
Hi Shung-Hsi,
Thanks, that makes sense.
I was mixing up two different things here: the BPF docs say not to add
"Cc: stable@xxxxxxxxxxxxxxx" to the patch description as a stable tag, and
instead ask BPF maintainers to queue stable fixes. Cc'ing stable@ in the
email headers for awareness is separate. Thanks for pointing this out.
Thanks also for pointing out the 6.6.y requirement. I'll make sure v2 takes
the stable ordering requirement into account before targeting 6.1.y.
I ran the suggested checks with the same reproducer, where BAD means the
program ran and observed the unexpected error, and GOOD means no error was
observed:
- latest 6.6.y, v6.6.142 (924b4a879cbb): BAD
- bpf-next at b93c55b4932d: GOOD
- bpf-next with the d028f87517d6 JNE refinement reverted: still GOOD
So the issue still reproduces on the latest 6.6.y, but d028f87517d6 alone
does not explain why bpf-next passes. I'll do more narrowing and update the
candidate backport set accordingly.
I'm also happy to add a BPF selftest for this. I plan to send a v2 series
later this week.
BR,
Zhenzhong
Shung-Hsi Yu <shung-hsi.yu@xxxxxxxx>于2026年6月2日 周二17:18写道:
On Tue, Jun 2, 2026 at 5:18 PM Shung-Hsi Yu <shung-hsi.yu@xxxxxxxx> wrote:
>
> On Tue, Jun 02, 2026 at 02:42:35PM +0800, Shung-Hsi Yu wrote:
> > On Tue, Jun 02, 2026 at 01:47:01PM +0800, Shung-Hsi Yu wrote:
> > ...
> > > On Tue, Jun 02, 2026 at 02:03:58AM +0800, Zhenzhong Wu wrote:
> > > > Hi BPF maintainers,
> > > >
> > > > This RFC backports two BPF verifier scalar range-tracking fixes to 6.1.y.
> > > > The series is intended to fix a verifier state-pruning issue where an
> > > > impossible scalar path can be kept while the real success path is pruned.
> > > >
> > > > This is a verifier scalar range-tracking issue, not a helper-specific
> > > > issue.
> > > > The visible failure is that the verifier can prune the real success
> > > > continuation, which should not be skipped, and keep only an impossible one.
> > > ...
> > >
> > > This sounds somewhat similar to the issue fixed in "backport of iterator
> > > and callback handling fixes" for stable 6.6[1] by @Eduard. Could you try
> > > to test on the latest stable 6.6.y as well at see if you can reproduce
> > > the issue there?
> > ...
> >
> > My mistake, the reproducer you had doesn't use iterator or callback, so
> > probably not fixed in stable 6.6. I'll take a better look at this later
> > this week.
>
> Two more ideas beside testing on latest stable 6.6.
>
> 1. Can you try testing on bpf-next, but with commit d028f87517d6 'bpf:
> make the verifier tracks the "not equal" for regs' reverted? My
> concern is that it is possible that commit d028f87517d6 does not
> address the root cause of incorrect state pruning here.
>
> If the reproducer _fails_ to reproduce the issue even with commit
> d028f87517d6 reverted, then it is possible that the root cause was
> fixed by another commit further down the line.
>
> 2. Have you consider adding your reproducer into BPF selftests? Would be
> very useful to have in stable (though it needs to first land in
> bpf-next first).
>
> > > 1: https://lore.kernel.org/stable/20240125001554.25287-1-eddyz87@xxxxxxxxx/
> > > 2: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html