__cgroup_bpf_run_filter_sk(9)
πΈ __cgroup_bpf_run_filter_sk πΈ
okay bestie, so this one lives in the Kernel API Manual and it's literally the little function that makes a BPF program go brrr on a socket π
the name is __cgroup_bpf_run_filter_sk and no, the double underscore isn't a typo, it's just how the kernel do π«Ά
β¨ NAME β¨
__cgroup_bpf_run_filter_sk β run a program on a sock 𧦠(yes, that's the actual name, don't come for me)
π SYNOPSIS π
int __cgroup_bpf_run_filter_sk (struct sock *sk , enum
cgroup_bpf_attach_type atype );
π ARGUMENTS π
skβ thesockstructure you're gonna manipulate, that's the whole vibe, she's the main character here πatypeβ the type of program that's gonna be executed β¨
π¦ DESCRIPTION π¦
so the socket you pass in is expected to be of type INET or INET6, periodt. anything else and that's on you, not her π
also, the program type you pass in via type must be suitable for sock filtering β and the function just... trusts you?? no cap, no further check is performed to assert that π so like, read the docs, bestie, fr fr.
here's the tea on return values π:
this function returns-EPERMif any attached program was found and it returned!= 1during execution. in all other cases,0is returned. so like,!= 1= blocked, got it? lowkey stressful but okay π
π SEE ALSO π
kernel file ./kernel/bpf/cgroup.c, plus the whole bestie squad:
cgroup_bpf_release(9)cgroup_bpf_release_fn(9)cgroup_bpf_inherit(9)__cgroup_bpf_attach(9)__cgroup_bpf_replace(9)purge_effective_progs(9)__cgroup_bpf_detach(9)__cgroup_bpf_run_filter_skb(9)__cgroup_bpf_run_filter_sock_addr(9)__cgroup_bpf_run_filter_sock_ops(9)__cgroup_bpf_run_filter_sysctl(9)
β alright that's the whole page, you ate that π
π this icon was served to you fresh from ./kernel/bpf, dated October 2026, under the Kernel API Manual banner β go forth and filter some sockets, queen ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms