Skip to contentSkip to conversation

selinux: add a 5 second sleep to /sys/fs/selinux/user

PATCH Applied Paul Moore 1 participant 3 messages May 1, 2025 – Jun 9, 2025 SELinux security module

lore
Share & tools
lore

Paul Moore

author maintainer
#0 lore raw

PATCH 1/1 selinux: add a 5 second sleep to /sys/fs/selinux/user

Commit d7b6918e22c7 ("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.

---
 security/selinux/selinuxfs.c | 1 +
 1 file changed, 1 insertion(+)
security/selinux/selinuxfs.c +1 -0
index 47480eb2189b..8b2626c0ffcb 100644
@@ -1072,6 +1072,7 @@ static ssize_t sel_write_user(struct file *file, char *buf, size_t size)
 	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);
+	ssleep(5);
 
 	length = avc_has_perm(current_sid(), SECINITSID_SECURITY,
 			      SECCLASS_SECURITY, SECURITY__COMPUTE_USER,
Signature · 1 line
2.49.0
author maintainer Applied
#1 lore raw
Quoted 11 lines · Paul Moore

Commit d7b6918e22c7 ("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.

Quoted 8 lines

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.

---
 security/selinux/selinuxfs.c | 1 +
 1 file changed, 1 insertion(+)

Merged into selinux/dev-staging with the expectation of moving this to selinux/dev after the upcoming merge window.

Signature · 1 line
paul-moore.com
author maintainer
#2 lore raw
Quoted 16 lines · Paul Moore
Quoted 15 lines · Paul Moore

Commit d7b6918e22c7 ("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.

Quoted 7 lines
Quoted 4 lines
---
 security/selinux/selinuxfs.c | 1 +
 1 file changed, 1 insertion(+)

Merged into selinux/dev-staging with the expectation of moving this to selinux/dev after the upcoming merge window.

This is now in selinux/dev.

Signature · 1 line
paul-moore.com