Skip to contentSkip to conversation

selinux: runtime disable is deprecated, add some ssleep() discomfort

RFC PATCH Applied Paul Moore 2 participants 4 messages Mar 1, 2022 – Apr 4, 2022 SELinux security module

lore
Share & tools
lore

Paul Moore

author maintainer
#0 lore raw

RFC PATCH 1/1 selinux: runtime disable is deprecated, add some ssleep() discomfort

We deprecated the SELinux runtime disable functionality in Linux v5.6, and it is time to get a bit more serious about removing it. Add a five second sleep to anyone using it to help draw their attention to the deprecation and provide a URL which helps explain things in more detail, including how to add kernel command line parameters to some of the more popular Linux distributions.

---
 security/selinux/selinuxfs.c |    2 ++
 1 file changed, 2 insertions(+)
security/selinux/selinuxfs.c +2 -0
index f2f6203e0fff..3739155ee0db 100644
@@ -293,6 +293,8 @@ static ssize_t sel_write_disable(struct file *file, const char __user *buf,
 	 *       kernel releases until eventually it is removed
 	 */
 	pr_err("SELinux:  Runtime disable is deprecated, use selinux=0 on the kernel cmdline.\n");
+	pr_err("SELinux:  https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-runtime-disable\n");
+	ssleep(5);
 
 	if (count >= PAGE_SIZE)
 		return -ENOMEM;
author maintainer
#1 lore raw
Quoted 8 lines · Paul Moore

We deprecated the SELinux runtime disable functionality in Linux v5.6, and it is time to get a bit more serious about removing it. Add a five second sleep to anyone using it to help draw their attention to the deprecation and provide a URL which helps explain things in more detail, including how to add kernel command line parameters to some of the more popular Linux distributions.

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

Comments are also welcome on the text in the URL shown as part of the error message below.

Quoted 14 lines
security/selinux/selinuxfs.c +2 -0
index f2f6203e0fff..3739155ee0db 100644
@@ -293,6 +293,8 @@ static ssize_t sel_write_disable(struct file *file, const char __user *buf,
         *       kernel releases until eventually it is removed
         */
        pr_err("SELinux:  Runtime disable is deprecated, use selinux=0 on the kernel cmdline.\n");
+       pr_err("SELinux:  https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-runtime-disable\n");
+       ssleep(5);
 
        if (count >= PAGE_SIZE)
                return -ENOMEM;
Signature · 1 line
paul-moore.com
Acked-by on v1 1/1
#2 lore raw
In reply to Paul Moore
Quoted 8 lines · Paul Moore

We deprecated the SELinux runtime disable functionality in Linux v5.6, and it is time to get a bit more serious about removing it. Add a five second sleep to anyone using it to help draw their attention to the deprecation and provide a URL which helps explain things in more detail, including how to add kernel command line parameters to some of the more popular Linux distributions.

Thank you for pressing on this. FWIW -

Quoted 18 lines
---
  security/selinux/selinuxfs.c |    2 ++
  1 file changed, 2 insertions(+)
security/selinux/selinuxfs.c +2 -0
index f2f6203e0fff..3739155ee0db 100644
@@ -293,6 +293,8 @@ static ssize_t sel_write_disable(struct file *file, const char __user *buf,
  	 *       kernel releases until eventually it is removed
  	 */
  	pr_err("SELinux:  Runtime disable is deprecated, use selinux=0 on the kernel cmdline.\n");
+	pr_err("SELinux:  https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-runtime-disable\n");
+	ssleep(5);
 
  	if (count >= PAGE_SIZE)
  		return -ENOMEM;
author maintainer Applied
#3 lore raw
In reply to Paul Moore
Quoted 8 lines · Paul Moore

We deprecated the SELinux runtime disable functionality in Linux v5.6, and it is time to get a bit more serious about removing it. Add a five second sleep to anyone using it to help draw their attention to the deprecation and provide a URL which helps explain things in more detail, including how to add kernel command line parameters to some of the more popular Linux distributions.

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

Merged into selinux/next.

Signature · 1 line
paul-moore.com