__cgroup_bpf...ilter_sysctl(9)
π
__cgroup_bpf...ilter_sysctl(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes, the whole manual, and today's main character is __cgroup_bpf...ilter_sysctl. buckle up, this one's a little baddie that runs a BPF program whenever somebody touches a sysctl π
β¨ NAME β¨
__cgroup_bpf_run_filter_sysctl β literally just run a program on sysctl π«Ά
β¨ SYNOPSIS β¨
int __cgroup_bpf_run_filter_sysctl (struct ctl_table_header *head ,
const struct ctl_table *table , int write , char **buf , size_t *pcount
, loff_t *ppos , enum cgroup_bpf_attach_type atype );
no cap, that's the whole signature β seven arguments, one int coming back at you π
πΈ ARGUMENTS πΈ
headβ the sysctl table header, iconic, essential, the blueprint πtableβ the sysctl table itself, the actual vibewriteβ tells you if the sysctl is being read (= 0) or written (= 1). zero or one, that's the whole personality π¦bufβ pointer to the buffer, and it's a both ways situation: in and out πpcountβ a value-result argument, she does both jobs: the value going in is the size of the buffer thatbufpoints to, and the result coming out is the size ofnew_bufif the program set a new value β otherwise it's the initial value πpposβ another value-result argument, double duty again: the value in is the position where the read from or write to the sysctl is happening, and the result is the new position if the program overrode it β otherwise, you guessed it, initial value πatypeβ the type of program that's gonna be executed π
π¦ DESCRIPTION π¦
the program runs whenever the sysctl is being accessed β read or write, either way, she's there β and it gets to allow or deny that access. gatekeeping, but make it kernel-level ππ₯
and here's the tea: this function returns -EPERM if an attached program is found and it returns a value != 1 during execution. in all other cases, 0 is returned. periodt π
π SEE ALSO π
kernel file ./kernel/bpf/cgroup.c β go read her, she's the source bestie π§
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_sk(9)__cgroup_bpf_run_filter_sock_addr(9)__cgroup_bpf_run_filter_sock_ops(9)
the whole friend group, honestly π―ββοΈπ
ngl bestie, remember the whole thing hinges on that!= 1check β anything that isn't exactly1and you're getting-EPERM'd straight out the door π
and that's the page! πΈ sourced from ./kernel/bpf, dated October 2026, and it's the __cgroup_bpf...ilter_sysctl(9) manual β mwah, slay, go forth and filter those sysctls π
β¨π
π¦ 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