Skip to content

Commit d7b6918

Browse files
stephensmalleypcmoore
authored andcommitted
selinux: Deprecate /sys/fs/selinux/user
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 <stephen.smalley.work@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent 9aba55b commit d7b6918

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
What: /sys/fs/selinux/user
2+
Date: April 2005 (predates git)
3+
KernelVersion: 2.6.12-rc2 (predates git)
4+
Contact: selinux@vger.kernel.org
5+
Description:
6+
7+
The selinuxfs "user" node allows userspace to request a list
8+
of security contexts that can be reached for a given SELinux
9+
user from a given starting context. This was used by libselinux
10+
when various login-style programs requested contexts for
11+
users, but libselinux stopped using it in 2020.
12+
Kernel support will be removed no sooner than Dec 2025.

security/selinux/selinuxfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,10 @@ static ssize_t sel_write_user(struct file *file, char *buf, size_t size)
10691069
int rc;
10701070
u32 i, len, nsids;
10711071

1072+
pr_warn_ratelimited("SELinux: %s (%d) wrote to /sys/fs/selinux/user!"
1073+
" This will not be supported in the future; please update your"
1074+
" userspace.\n", current->comm, current->pid);
1075+
10721076
length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
10731077
SECCLASS_SECURITY, SECURITY__COMPUTE_USER,
10741078
NULL);

0 commit comments

Comments
 (0)