STRUCT SECCOMP_KADDFD(9)
π struct seccomp_kaddfd(9) π
okay bestie, welcome to the Kernel API Manual β¨ β yes, that's the manual name, we're fancy here. no cap. this one's about a lil struct that's basically a little container for seccomp_addfd ioctl messages π«Ά
πΈ NAME πΈ
struct seccomp_kaddfd β literally just a container for seccomp_addfd ioctl messages, that's her whole job π
π¦ SYNOPSIS π¦
struct seccomp_kaddfd {
struct file *file;
int fd;
unsigned int flags;
__u32 ioctl_flags;
union {
bool setfd;
int ret;
};
struct completion completion;
struct list_head list;
};
like, look at her. iconic shape. perfect struct energy π
π Members π
fileβ a reference to the file that's gonna get installed in the other task ποΈfdβ the fd number to install it at, iykyk. but wait β if the fd number is-1, that means the installing process should allocate the fd as normal β¨ (so-1is basically "you pick, king")flagsβ the flags for the new file descriptor. and at the moment, onlyO_CLOEXECis allowed, periodt π« no other flags are getting past the bouncerioctl_flagsβ the flags used for theseccomp_addfdioctl π«{unnamed_union}β anonymous. she has no name. mysterious. main character energy fr πsetfdβ whether or notSECCOMP_ADDFD_FLAG_SETFDwas set duringnotify_addfdβretβ the return value of the installing process. it's set to the fd num upon success (>= 0) βcompletionβ indicates that the installing process has completed fd installation, or gone away β either because of a successful reply, or because of a signal π (she's an angel, she always lets you know)listβ thelist_headfor chainingseccomp_kaddfdtogether π gotta link the girls up
π SEE ALSO π
kernel file ./kernel/seccomp.c β go read it, it's giving lore:
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), seccomp_set_mode_filter(9), prctl_set_seccomp(9)
okay that's the whole page!! this one came from ./kernel and it's dated October 2026 π so go forth, understand your struct, and slay π
π π§
π¦ 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