]> Git Repo - J-linux.git/commitdiff
selinux: Deprecate /sys/fs/selinux/user
authorStephen Smalley <[email protected]>
Fri, 4 Oct 2024 17:27:10 +0000 (13:27 -0400)
committerPaul Moore <[email protected]>
Mon, 7 Oct 2024 20:39:49 +0000 (16:39 -0400)
The only known user of this interface was libselinux and its
internal usage of this interface for get_ordered_context_list(3)
was removed in Feb 2020, with a deprecation warning added to
security_compute_user(3) at the same time. Add a deprecation
warning to the kernel and schedule it for final removal in 2025.

Signed-off-by: Stephen Smalley <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
Documentation/ABI/obsolete/sysfs-selinux-user [new file with mode: 0644]
security/selinux/selinuxfs.c

diff --git a/Documentation/ABI/obsolete/sysfs-selinux-user b/Documentation/ABI/obsolete/sysfs-selinux-user
new file mode 100644 (file)
index 0000000..8ab7557
--- /dev/null
@@ -0,0 +1,12 @@
+What:          /sys/fs/selinux/user
+Date:          April 2005 (predates git)
+KernelVersion: 2.6.12-rc2 (predates git)
+Contact:       [email protected]
+Description:
+
+       The selinuxfs "user" node allows userspace to request a list
+       of security contexts that can be reached for a given SELinux
+       user from a given starting context. This was used by libselinux
+       when various login-style programs requested contexts for
+       users, but libselinux stopped using it in 2020.
+       Kernel support will be removed no sooner than Dec 2025.
index e172f182b65cc360d2734330864ce9070f83f005..234f4789b787474799aa873168522b475fa89129 100644 (file)
@@ -1069,6 +1069,10 @@ static ssize_t sel_write_user(struct file *file, char *buf, size_t size)
        int rc;
        u32 i, len, nsids;
 
+       pr_warn_ratelimited("SELinux: %s (%d) wrote to /sys/fs/selinux/user!"
+               " This will not be supported in the future; please update your"
+               " userspace.\n", current->comm, current->pid);
+
        length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
                              SECCLASS_SECURITY, SECURITY__COMPUTE_USER,
                              NULL);
This page took 0.055289 seconds and 4 git commands to generate.