is_masked_device_ioctl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

  1. The command is implemented in fs/ioctl.c's do_vfs_ioctl, not in f_ops->unlocked_ioctl or f_ops->compat_ioctl.
  2. 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 in fs/ioctl.c's do_vfs_ioctl should 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 🌈


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