Description
While reading the documentation on cgroup eBPF program types, I found it unclear how to attach a program to a specific cgroup. The provided examples always demonstrate attaching to a generic cgroup hook, without specifying which cgroup the program is actually attached to.
For instance, in the example for attaching an eBPF program of type CGROUP_SOCK, the SEC macro defines the program like this:
SEC("cgroup/sock_create")
However, it's unclear whether "cgroup" here refers to the type of eBPF program attachment (such as 'lsm' for LSM eBPF programs) or to the root cgroup of the system (/sys/fs/cgroup/). There is no explanation on how to target specific cgroups beyond the root.
I suggest to add at the root of the folder (https://docs.ebpf.io/linux/program-type/), in the cGroup program types
section, a detailed examples on how to attach eBPF programs to cgroups other than the root.