tomoyo_file_open(9)
π tomoyo_file_open(9) β a Kernel API Manual moment
okay so bestie, we're in the Kernel API Manual today and the star of the show is tomoyo_file_open(9). yes it's a whole LSM thing, yes it's iconic, let's get into it π
β¨ NAME β¨
tomoyo_file_open β literally the target for security_file_open(). that's it, that's the vibe π¦
πΈ SYNOPSIS πΈ
int tomoyo_file_open (struct file *f );
π§ ARGUMENTS π§
fβ a pointer tostruct file. just a lil pointer, no big deal, she's pointing at a file structure and she knows it π
π₯ DESCRIPTION π₯
so what does she do? she returns 0 on success β¨ and a negative value otherwise π that's the whole tea, no cap.
like, that's genuinely it. short queen behavior. we love a function that knows what she is and doesn't over-explain π«Ά
ngl this is a security hook, so "negative value otherwise" means something went sideways β treat that negative return like a red flag in the group chat, bestie π
π SEE ALSO π
okay this is the part where she introduces you to her entire friend group. they're all (9) pages, they're all TOMOYO, and yes you will be meeting all of them π
the kernel file to peek at is ./security/tomoyo/tomoyo.c β start there, iykyk π
and then, in no particular order, the whole squad:
tomoyo_domain(9)tomoyo_cred_prepare(9)tomoyo_bprm_committed_creds(9)tomoyo_bprm_creds_for_exec(9)tomoyo_bprm_check_security(9)tomoyo_inode_getattr(9)tomoyo_path_truncate(9)tomoyo_file_truncate(9)tomoyo_path_unlink(9)tomoyo_path_mkdir(9)tomoyo_path_rmdir(9)tomoyo_path_symlink(9)tomoyo_path_mknod(9)tomoyo_path_link(9)tomoyo_path_rename(9)tomoyo_file_fcntl(9)tomoyo_file_ioctl(9)tomoyo_path_chmod(9)tomoyo_path_chown(9)tomoyo_path_chroot(9)tomoyo_sb_mount(9)tomoyo_sb_umount(9)tomoyo_sb_pivotroot(9)tomoyo_socket_listen(9)tomoyo_socket_connect(9)tomoyo_socket_bind(9)tomoyo_socket_sendmsg(9)tomoyo_task_alloc(9)tomoyo_task_free(9)tomoyo_init(9)
and that's the page, bestie β¨ this lil masterpiece lives in ./security/tomoyo, it's dated October 2026, and its whole full name is tomoyo_file_open(9) β go forth and security_file_open() responsibly πππ¦
π¦ 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