selinux_mmap_backing_file(9)
β¨ selinux_mmap_backing_file(9) β¨
welcome to the Kernel API Manual, bestie π«Ά β this is the page for selinux_mmap_backing_file(9), and it's literally all about checking mmap permissions on a backing file. iconic security behavior, no cap π
πΈ NAME πΈ
selinux_mmap_backing_fileβ check mmap permissions on a backing file β¨
π SYNOPSIS π
okay so the signature is exactly this, bestie β copy it character for character:
int selinux_mmap_backing_file (struct vm_area_struct *vma , struct file
*backing_file , struct file *user_file );
π ARGUMENTS π
vmaβ memory region πΈbacking_fileβ stacked filesystem backing file πuser_fileβ user visible file π¦
π¦ DESCRIPTION π¦
okay so here's the tea β: this is called after selinux_mmap_file on stacked filesystems. and it is this function's responsibility to verify access to backing_file and setup the SELinux state for possible later use in the mprotect code path. periodt. π
by the time this function is called, mmap access to user_file has already been authorized, and vma->vm_file has been set to point to backing_file. so like, that part is already handled β this function is doing its own backing-file security check era π«Άβ¨
return vibes: return zero on success, negative values otherwise. that's the whole return contract, bestie ππ
π SEE ALSO π
also peep the Kernel file ./security/selinux/hooks.c and these iconique references:
selinux_secmark_enabled(9)selinux_peerlbl_enabled(9)task_avdcache_reset(9)task_avdcache_search(9)task_avdcache_update(9)selinux_inode_permission(9)selinux_inode_xattr_skipcap(9)selinux_skb_peerlbl_sid(9)selinux_conn_sid(9)selinux_getselfattr(9)selinux_uring_override_creds(9)selinux_uring_sqpoll(9)selinux_uring_cmd(9)selinux_uring_allowed(9)
okay that's the whole page, bestie ππ it comes from ./security/selinux, dated October 2026, and it's selinux_mmap_backing_file(9). go forth and mmap 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