Re: [PATCH bpf-next v12 1/5] bpf: Move constants blinding out of arch-specific JITs

From: Xu Kuohai

Date: Thu Apr 09 2026 - 08:29:23 EST


On 4/4/2026 12:04 AM, Emil Tsalapatis wrote:
/* Pass 3: Adjust jump offset and write final image */
if (build_body(&ctx, extra_pass) ||
- WARN_ON_ONCE(ctx.idx != ctx.epilogue_offset)) {
- prog = orig_prog;
+ WARN_ON_ONCE(ctx.idx != ctx.epilogue_offset))
This thunk is slightly different now, the WARN_ON_ONCE() won't be checked
if build_body() succeeds.

Sorry, I do not see the difference here. The WARN_ON_ONCE() is still checked
when build_body() returns 0 (succeeds) due to the '||' evaluation.

Do we even need it? AFAICT the only case it
wouldn't trigger if build_body() fails is if it did so at the very last
instruction. Alternatively, should we check it if build_body() succeeds
instead to retain the old behavior?

goto out_free_hdr;
- }