Re: [PATCH bpf-next 1/2] bpf: Reject callback subprogs invoke tailcall
From: bot+bpf-ci
Date: Sat Jul 11 2026 - 07:34:04 EST
> bpf: Reject callback subprogs invoke tailcall
>
> Some JIT compilers, such as x86_64, rely on a register to pass the TCC.
> When subprograms of synchronous callback invoke tailcall, C helpers
> invoking bpf callback clobber this register, and the corrupted TCC may
> bypass the TCC limit, leading to infinite tailcall.
>
> Fix this by rejecting tailcall inside all subprogs of sync callback.
> This also cleanly consolidates the existing async and exception callback
> checks into a single unified `is_cb` check.
>
> Signed-off-by: Pu Lehui <pulehui@xxxxxxxxxx>
This looks like a bug fix, but there is no Fixes: tag.
The change broadens the tail_call_reachable guard in
check_max_stack_depth_subprog() from the exception-only test to the
unified is_cb test:
if (subprog[tmp].is_cb)
The narrower "cannot tail call within exception cb" guard it replaces was
added by commit b9ae0c9dd0ac, which only covered exception callbacks and
left synchronous callbacks unprotected. Should this carry:
Fixes: b9ae0c9dd0ac ("bpf: Add support for custom exception callbacks")
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/29150078207