selinux: implement the security_uring_cmd() LSM hook
authorPaul Moore <paul@paul-moore.com>
Wed, 10 Aug 2022 19:55:36 +0000 (15:55 -0400)
committerPaul Moore <paul@paul-moore.com>
Fri, 26 Aug 2022 15:19:43 +0000 (11:19 -0400)
commitf4d653dcaa4e4056e1630423e6a8ece4869b544f
tree36943975de28bc16aceaade7c51c2988cc6f71e6
parent2a5840124009f133bd09fd855963551fb2cefe22
selinux: implement the security_uring_cmd() LSM hook

Add a SELinux access control for the iouring IORING_OP_URING_CMD
command.  This includes the addition of a new permission in the
existing "io_uring" object class: "cmd".  The subject of the new
permission check is the domain of the process requesting access, the
object is the open file which points to the device/file that is the
target of the IORING_OP_URING_CMD operation.  A sample policy rule
is shown below:

  allow <domain> <file>:io_uring { cmd };

Cc: stable@vger.kernel.org
Fixes: ee692a21e9bf ("fs,io_uring: add infrastructure for uring-cmd")
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c
security/selinux/include/classmap.h