diff options
| author | Shakeel Butt <shakeel.butt@linux.dev> | 2026-10-01 07:19:01 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-10-01 15:39:24 +0000 |
| commit | b5a4aa31abd6fe90009b63e35dc18c67d041ec0c (patch) | |
| tree | 2fd2bf45fedec71fe815e47c77bf3c9327401fff /include/linux/timerqueue.h | |
| parent | 6a75c73eebd4d497ded7d08b47894f9ddbebb5a9 (diff) | |
| download | linux-next-b5a4aa31abd6fe90009b63e35dc18c67d041ec0c.tar.gz linux-next-b5a4aa31abd6fe90009b63e35dc18c67d041ec0c.zip | |
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 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'". The check is not needed anyway. When the key is off nothing is
attached, so progs[atype] and effective[atype] are empty and the count loop
leaves total_cnt at 0. The other attach types already use that loop with
no such check. Drop the check and the skip_count label.
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.
Fixes: 369d9dcd8fb8 ("bpf: Add infrastructure to support attaching struct_ops to cgroups")
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Amery Hung <ameryhung@gmail.com>
Acked-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://patch.msgid.link/20261001141901.3225830-1-shakeel.butt@linux.dev
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
