]> git.ipfire.org Git - thirdparty/linux.git/commit
Merge branch 'fix-effective-prog-array-indexing-with-bpf_f_preorder'
authorAlexei Starovoitov <ast@kernel.org>
Mon, 22 Jun 2026 01:10:04 +0000 (18:10 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 22 Jun 2026 01:11:09 +0000 (18:11 -0700)
commit3d8e6fef15db07c9247c1301ec6fa5532d15feb8
tree004e66c20636acb510ebd36d62477b89c1a0f2d8
parent8405c4626460503027461652f96d8bb10c2a9173
parenta6ff26f360c87b7c9f76f493bcecb9223d87e9db
Merge branch 'fix-effective-prog-array-indexing-with-bpf_f_preorder'

Amery Hung says:

====================
Fix effective prog array indexing with BPF_F_PREORDER

This patchset fixes a cgroup effective-array indexing bug where
replace_effective_prog() and purge_effective_progs() used a linear hlist
position that doesn't match the array layout when BPF_F_PREORDER
programs are present, corrupting the array on link update and risking a
use-after-free in the detach fallback. It computes the slot via a shared
effective_prog_pos() helper and adds a cgroup_preorder selftest.

Changelog

v1 -> v2:
 - Also fix purge_effective_progs(), in addition to
   replace_effective_prog() (Sashiko).
 - selftest: Set err on bpf_link_create() failure so the failure is
   reported to the caller (Sashiko).
====================

Link: https://patch.msgid.link/20260619063520.2690547-1-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>