Re: [PATCH bpf] net/sched: cls_bpf: prevent unbounded recursion in offload rollback
From: Alexei Starovoitov
Date: Mon May 25 2026 - 14:57:18 EST
On Mon, May 25, 2026 at 11:03 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote:
>
> On Fri, 22 May 2026 10:58:53 +0800 Jiayuan Chen wrote:
> > - if (prog && err) {
> > - cls_bpf_offload_cmd(tp, oldprog, prog, extack);
> > + if (prog && err && !is_rollback) {
> > + cls_bpf_offload_cmd(tp, oldprog, prog, extack, true);
> > return err;
> > }
>
> Doesn't matter in practice but for code clarity we should only gate
> the call to cls_bpf_offload_cmd() not the entire error path.
>
> With that:
>
> Reviewed-by: Jakub Kicinski <kuba@xxxxxxxxxx>
>
> I'd take this via -next.
feel free to take it into net-next directly.