Re: [RFC PATCH 1/4] bpf, cgroup: fix cgroup struct_ops query for a second attach type
From: bot+bpf-ci
Date: Mon Sep 21 2026 - 16:34:45 EST
> bpf, cgroup: fix cgroup struct_ops query for a second attach type
>
> Two things in __cgroup_bpf_query() work only because CGROUP_TCP_SOCK_OPS is
> the only one struct_ops attach type.
>
> It calls cgroup_bpf_enabled(atype) with an atype that
> find_atype_by_struct_ops_id() works out at runtime. That macro is an asm
> goto and needs a constant. Today the compiler can see there is only one
> value; add a second type and the build breaks with "impossible constraint in
> 'asm'". Add cgroup_bpf_enabled_runtime(), which reads the key instead, and
> use it here. This is a syscall path, so the cost does not matter.
>
> And find_atype_by_struct_ops_id() matches on type_id alone. An attach type
> whose subsystem is not built keeps type_id 0, so a query for type 0 finds it
> and returns success with nothing instead of -ENOENT. Skip such slots.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
This looks like a bug fix for the struct_ops attach infrastructure.
Should this include:
Fixes: 369d9dcd8fb8 ("bpf: Add infrastructure to support attaching struct_ops to cgroups")
---
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/35646140734