]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/bpf: Test cgroup link replace with BPF_F_PREORDER
authorAmery Hung <ameryhung@gmail.com>
Fri, 19 Jun 2026 06:35:20 +0000 (23:35 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 22 Jun 2026 01:10:04 +0000 (18:10 -0700)
commita6ff26f360c87b7c9f76f493bcecb9223d87e9db
tree004e66c20636acb510ebd36d62477b89c1a0f2d8
parentf08aaee3152d0dfc578b3f2586932d82062701dd
selftests/bpf: Test cgroup link replace with BPF_F_PREORDER

Add a cgroup_preorder case that attaches a normal and a BPF_F_PREORDER
program to a cgroup (effective order [2, 1]), then replaces the normal
link's program via bpf_link_update() and checks the effective order
becomes [2, 3] — i.e. only the non-preorder slot changes. Without the
replace_effective_prog() fix the array is corrupted and the order is
wrong.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20260619063520.2690547-3-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/cgroup_preorder.c