Re: [PATCH] bpf: Fix cgroup link update after a failed effective array rebuild

From: Alexei Starovoitov

Date: Thu Nov 12 2026 - 19:45:21 EST


On Thu Nov 12, 2026 at 1:49 PM UTC, Shihuang Liu wrote:
> replace_effective_prog() uses the position of a cgroup program list
> entry as a physical index into the effective program array. When an
> OOM detach falls back to purge_effective_progs(), the detached entry is
> replaced by a dummy but the other entries keep their position, so the
> list position no longer matches the array index. A later link update
> then writes the new program into the wrong slot, leaving the old
> program pointer in the array. The array does not hold a reference, so
> the old program can be freed while it is still published.

I doubt you managed to reproduce such scenario.
So wont-fix until there is one.

pw-bot: cr