seccomp_set_mode_filter(9)
π seccomp_set_mode_filter β like, the internal function for setting seccomp filter (this is from the Kernel API Manual, bestie, section 9) π
β¨ NAME β¨
seccomp_set_mode_filter β the internal function that handles setting up your seccomp filter. yes it's internal, no you can't just call it from your little userspace program, it's kernel business π
πΈ SYNOPSIS πΈ
long seccomp_set_mode_filter (unsigned int flags , const char __user
*filter );
π¦ ARGUMENTS π¦
flagsβ the flags that change how the filter behaves, icon behavior frfilterβ astruct sock_fprogthat's holding your filter, she's the main character here π
π DESCRIPTION π
okay so the way this works is β you can literally call this function repeatedly to install additional filters. like, stack them. the more the merrier, no cap.
Every filter that gets successfully installed will be evaluated in reverse order for each system call the task makes. so the last one you added gets checked first, iykyk π₯
Once current->seccomp.mode is non-zero, it may not be changed. that's it, that's the rule, it's locked in, periodt. π
Returns 0 on success or -EINVAL on failure. that's literally it, those are the two outcomes, she's not complicated π«Ά
π SEE ALSO π
- Kernel file
./kernel/seccomp.c struct seccomp_kaddfd(9)struct notification(9)struct action_cache(9)struct seccomp_filter(9)seccomp_check_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)prctl_set_seccomp(9)
go read them, they're all in their slay era too β
okay that's the whole page!! this little gem lives in ./kernel, dated October 2026, and it's seccomp_set_mode_filter(9) all day every day π§π hope you understood it bestie, 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