file->f_op->uring_cmd is a generic command multiplexer through which files can implement file-specific commands.
This is similar to ioctl(2) in that sense, although the command numbers have a different namespace.
We should maybe restrict that, similarly as we have done it for IOCTLs with LANDLOCK_ACCESS_FS_IOCTL_DEV.
This was brought up by Bryam Vargas in https://lore.kernel.org/all/20260616201633.275067-1-hexlabsecurity@proton.me/ (and the follow-up discussion). There can be overlaps between uring_cmd commands and IOCTL commands, as it was pointed out there for BLOCK_URING_CMD_DISCARD and ioctl(BLKDISCARD). In the case of such commands, it might be surprising that they are blocked when used through IOCTL but work when used through io_uring.
Another alternative approach would be to block the creation of an io_uring altogether, through a Landlock policy. That would be a coarser control, but maybe good enough for the start, for the majority of use cases?
file->f_op->uring_cmdis a generic command multiplexer through which files can implement file-specific commands.This is similar to ioctl(2) in that sense, although the command numbers have a different namespace.
We should maybe restrict that, similarly as we have done it for IOCTLs with
LANDLOCK_ACCESS_FS_IOCTL_DEV.This was brought up by Bryam Vargas in https://lore.kernel.org/all/20260616201633.275067-1-hexlabsecurity@proton.me/ (and the follow-up discussion). There can be overlaps between
uring_cmdcommands and IOCTL commands, as it was pointed out there forBLOCK_URING_CMD_DISCARDandioctl(BLKDISCARD). In the case of such commands, it might be surprising that they are blocked when used through IOCTL but work when used through io_uring.Another alternative approach would be to block the creation of an io_uring altogether, through a Landlock policy. That would be a coarser control, but maybe good enough for the start, for the majority of use cases?