Re: [PATCH bpf-next v2 2/3] selftests/bpf: Test querying BPF_F_PREORDER cgroup attachments
From: bot+bpf-ci
Date: Sat Sep 19 2026 - 06:43:25 EST
> selftests/bpf: Test querying BPF_F_PREORDER cgroup attachments
>
> Extend cgroup_mprog_opts selftests to verify that BPF_PROG_QUERY reports
> BPF_F_PREORDER in prog_attach_flags for both direct program and link
> attachments.
>
> Specifically, add assert_preorder_query_flags() and use it from
> test_preorder_prog_attach_detach() and
> test_preorder_link_attach_detach() to verify that:
> - Programs attached with BPF_F_PREORDER report
> BPF_F_ALLOW_MULTI | BPF_F_PREORDER (0x42) in prog_attach_flags.
> - Programs attached without BPF_F_PREORDER report BPF_F_ALLOW_MULTI (0x2).
> - Transient flags such as BPF_F_AFTER or BPF_F_LINK are not present in
> prog_attach_flags.
> - Per-program attach flags are validated by matching each attached prog_id
> via a query helper, avoiding fragile assumptions on the internal slot
> order of the direct query list.
> - Failures during prog_id lookup are guarded so uninitialized flag values
> do not trigger secondary assertion failures.
>
> Signed-off-by: Hui Su <sh_def@xxxxxxx>
This isn't a bug, but could the last two bullets be dropped so the
changelog stays on what behaviour is now covered, rather than describing
how the test helper is written?
The first three bullets state which behaviour the new test covers, which
is the useful part. The last two bullets describe how the test code is
written (a lookup helper instead of indexing, and guarding the lookup
return before reading the flags variable) rather than what kernel
behaviour is being pinned down; that detail is visible in the diff
itself.
---
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/35436378806