summaryrefslogtreecommitdiffstats
path: root/security/selinux/include/security.h
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2022-03-08 23:11:57 +0100
committerPaul Moore <paul@paul-moore.com>2022-04-04 22:24:22 +0200
commit81200b0265b15609dcecf192e3f7fb238ec0d3da (patch)
tree8ffcfe5948cf2a0c2faff817103cdb69ec8ca05d /security/selinux/include/security.h
parentselinux: runtime disable is deprecated, add some ssleep() discomfort (diff)
downloadlinux-81200b0265b15609dcecf192e3f7fb238ec0d3da.tar.xz
linux-81200b0265b15609dcecf192e3f7fb238ec0d3da.zip
selinux: checkreqprot is deprecated, add some ssleep() discomfort
The checkreqprot functionality was disabled by default back in Linux v4.4 (2015) with commit 2a35d196c160e3 ("selinux: change CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE default") and it was officially marked as deprecated in Linux v5.7. It was always a bit of a hack to workaround very old userspace and to the best of our knowledge, the checkreqprot functionality has been disabled by Linux distributions for quite some time. This patch moves the deprecation messages from KERN_WARNING to KERN_ERR and adds 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. Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/include/security.h')
-rw-r--r--security/selinux/include/security.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index ace4bd13e808..f7e6be63adfb 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -16,6 +16,8 @@
#include <linux/rcupdate.h>
#include <linux/refcount.h>
#include <linux/workqueue.h>
+#include <linux/delay.h>
+#include <linux/printk.h>
#include "flask.h"
#include "policycap.h"
@@ -150,6 +152,10 @@ static inline bool checkreqprot_get(const struct selinux_state *state)
static inline void checkreqprot_set(struct selinux_state *state, bool value)
{
+ if (value) {
+ pr_err("SELinux: https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-checkreqprot\n");
+ ssleep(5);
+ }
WRITE_ONCE(state->checkreqprot, value);
}