[RFC PATCH] selinux: rename io_uring permission to match syscall
From: Christian Göttsche
Date: Wed Mar 26 2025 - 06:44:52 EST
From: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
Commit c6ad9fdbd44b ("io_uring,lsm,selinux: add LSM hooks for
io_uring_setup()") introduced the LSM hook `uring_allowed` and
implemented it in SELinux via a new `io_uring` class permission
`allowed`. Rename the permission to `setup` since most permission verbs
are named after the corresponding syscall, in this case
io_uring_setup(2), and avoid confusing policy rules with an allow
keyword and an allowed permission.
Fixes: c6ad9fdbd44b ("io_uring,lsm,selinux: add LSM hooks for io_uring_setup()")
Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>
---
Note: this patch targets torvalds/master
---
security/selinux/hooks.c | 2 +-
security/selinux/include/classmap.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 7150c953fec3..bcc66dea8bdc 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -7188,7 +7188,7 @@ static int selinux_uring_allowed(void)
{
u32 sid = current_sid();
- return avc_has_perm(sid, sid, SECCLASS_IO_URING, IO_URING__ALLOWED,
+ return avc_has_perm(sid, sid, SECCLASS_IO_URING, IO_URING__SETUP,
NULL);
}
#endif /* CONFIG_IO_URING */
diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
index 04a9b480885e..49fb584f2056 100644
--- a/security/selinux/include/classmap.h
+++ b/security/selinux/include/classmap.h
@@ -179,7 +179,7 @@ const struct security_class_mapping secclass_map[] = {
{ "perf_event",
{ "open", "cpu", "kernel", "tracepoint", "read", "write", NULL } },
{ "anon_inode", { COMMON_FILE_PERMS, NULL } },
- { "io_uring", { "override_creds", "sqpoll", "cmd", "allowed", NULL } },
+ { "io_uring", { "override_creds", "sqpoll", "cmd", "setup", NULL } },
{ "user_namespace", { "create", NULL } },
/* last one */ { NULL, {} }
};
--
2.49.0