Skip to content

Commit 8a71d8f

Browse files
committed
selinux: add a 5 second sleep to /sys/fs/selinux/user
Commit d7b6918 ("selinux: Deprecate /sys/fs/selinux/user") started the deprecation process for /sys/fs/selinux/user: 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. A pr_warn() message has been in place since Linux v6.13, this patch adds a five second sleep to /sys/fs/selinux/user to help make the deprecation and upcoming removal more noticeable. Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent fe78e02 commit 8a71d8f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

security/selinux/selinuxfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ static ssize_t sel_write_user(struct file *file, char *buf, size_t size)
10721072
pr_warn_ratelimited("SELinux: %s (%d) wrote to /sys/fs/selinux/user!"
10731073
" This will not be supported in the future; please update your"
10741074
" userspace.\n", current->comm, current->pid);
1075+
ssleep(5);
10751076

10761077
length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
10771078
SECCLASS_SECURITY, SECURITY__COMPUTE_USER,

0 commit comments

Comments
 (0)