Re: [PATCH bpf-next 2/4] bpf: Queue the rewrites of bpf_do_misc_fixups() and apply them at once

From: Qiliang Yuan

Date: Fri Oct 02 2026 - 09:27:09 EST


> Take a backward may_goto whose grown offset is exactly -32768 (S16_MIN).
[...]
> Should the JEQ-or-gotol decision be deferred until the final offsets are
> known?

This is a real regression, and it is wider than one displacement: any
backward may_goto whose offset fits in s16 before the patches between
its target and itself are applied, but not after, now gets a JEQ and
fails at commit. Those patches are already queued when the loop
reaches the may_goto, so v2 will add their growth to the offset before
may_goto_expand() picks the encoding, which gives the old choice, and
add a selftest around the boundary.