seccomp_check_filter(9)
π seccomp_check_filter(9) β from the Kernel API Manual, section 9, bestie π
Okay so picture this: you're deep in the kernel, section 9 of the manual, and the function on the menu today is seccomp_check_filter. She's a little vibe-checker for seccomp filter code and honestly? She ate. β¨
πΈ NAME πΈ
seccomp_check_filter β the girl who verifies your seccomp filter code. no cap, that's literally her whole job π«Ά
π¦ SYNOPSIS π¦
int seccomp_check_filter (struct sock_filter *filter , unsigned int flen );
β¨ ARGUMENTS β¨
filterβ the filter to verify. yes bestie, this is the one getting the vibe check πflenβ the length of that filter. gotta know how much filter we're filtering, y'know? π
π DESCRIPTION π
So here's the tea, and it is strong π: seccomp_check_filter takes a filter that has already been checked β by bpf_check_classic, thank you very much β and then does her lil redirect magic. All the filter code that loads struct sk_buff data and related data gets redirected through seccomp_bpf_load. iconic behaviour, truly π
And she's not just out here redirecting for fun (well, a little for fun) β she also enforces length and alignment checking of those loads. meticulous. main character energy. the way she cares about alignment is honestly so real π
What does she give back? Simple:
- Returns
0if the rule set is legal π slay, valid, we love to see it - Returns
-EINVALif not π sorry babe, that rule set is not it
fr fr, -EINVAL is the "nope, illegal rule set, try again" of this whole situation. don't take it personally π
π SEE ALSO π
The kernel file ./kernel/seccomp.c is where the whole friend group lives β go say hi to:
struct seccomp_kaddfd(9)struct notification(9)struct action_cache(9)struct seccomp_filter(9)seccomp_cache_check_allow(9)seccomp_run_filters(9)seccomp_can_sync_threads(9)seccomp_filter_release(9)seccomp_sync_threads(9)seccomp_prepare_filter(9)seccomp_prepare_user_filter(9)seccomp_is_const_allow(9)seccomp_cache_prepare(9)seccomp_attach_filter(9)seccomp_set_mode_strict(9)seccomp_set_mode_filter(9)prctl_set_seccomp(9)
likeβ¦ the whole squad is in there. iykyk π
and that's the page, bestie! π§ This cutie lives in ./kernel and the version on the shelf is dated October 2026 β so when you're flipping through and see that date, that's me waving at you from the future. mwah ππΈ
π¦ 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