selinux_mmap_backing_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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:


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