is_masked_device_ioctl(9)
π is_masked_device_ioctl β a Kernel API Manual moment β¨
okay so bestie, we're in the Kernel API Manual today and this one is genuinely so niche and so cute. It's is_masked_device_ioctl(9) and it's basically the bouncer checking the guest list for ioctls on device files π
β¨ NAME β¨
is_masked_device_ioctl β figure out whether an IOCTL command is always permitted with Landlock for device files. Like, these commands literally can not be restricted on device files by enforcing a Landlock policy. They're grandfathered in, periodt π
πΈ SYNOPSIS πΈ
bool is_masked_device_ioctl (const unsigned int cmd );
π¦ ARGUMENTS π¦
cmdβ the IOCTL command that's supposed to be run. that's the whole vibe check right there π
π DESCRIPTION π
so by default, any IOCTL on a device file requires the LANDLOCK_ACCESS_FS_IOCTL_DEV right. yes, any. strict queen behavior π₯
but!! we blanket-permit some commands, and here's the criteria β if:
- The command is implemented in
fs/ioctl.c'sdo_vfs_ioctl, not inf_ops->unlocked_ioctlorf_ops->compat_ioctl. - The command is harmless when invoked on devices. no chaos, no drama, we love that for us π«Ά
we also permit commands that don't really make sense for devices, but where the do_vfs_ioctl implementation returns a more conventional error code. like okay, it's giving "why are you here" but the error message is polite so we let it slide π
heads up bestie: any new IOCTL commands that get implemented infs/ioctl.c'sdo_vfs_ioctlshould be considered for inclusion here. don't forget, or the list gets stale and nobody wants that π
π RETURN π
True if the IOCTL cmd can not be restricted with Landlock for device files, false otherwise. simple as that, slay β
π SEE ALSO π
- Kernel file
./security/landlock/fs.c get_inode_id(9)is_access_to_paths_allowed(9)collect_domain_accesses(9)current_check_refer_path(9)unmask_scoped_access(9)get_required_file_open_access(9)
okay that's the whole page, hope it ate π and for the receipt-keepers: this one's stamped from ./security/landlock, dated October 2026 β no cap, that's the source and the date, 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