Skip to content

Commit be6ec88

Browse files
committed
selinux: Remove SECURITY_SELINUX_BOOTPARAM_VALUE
In preparation for removing CONFIG_DEFAULT_SECURITY, this removes the soon-to-be redundant SECURITY_SELINUX_BOOTPARAM_VALUE. Since explicit ordering via CONFIG_LSM or "lsm=" will define whether an LSM is enabled or not, this CONFIG will become effectively ignored, so remove it. However, in order to stay backward-compatible with "security=selinux", the enable variable defaults to true. Signed-off-by: Kees Cook <keescook@chromium.org>
1 parent 0102fb8 commit be6ec88

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

‎security/selinux/Kconfig‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,6 @@ config SECURITY_SELINUX_BOOTPARAM
2222

2323
If you are unsure how to answer this question, answer N.
2424

25-
config SECURITY_SELINUX_BOOTPARAM_VALUE
26-
int "NSA SELinux boot parameter default value"
27-
depends on SECURITY_SELINUX_BOOTPARAM
28-
range 0 1
29-
default 1
30-
help
31-
This option sets the default value for the kernel parameter
32-
'selinux', which allows SELinux to be disabled at boot. If this
33-
option is set to 0 (zero), the SELinux kernel parameter will
34-
default to 0, disabling SELinux at bootup. If this option is
35-
set to 1 (one), the SELinux kernel parameter will default to 1,
36-
enabling SELinux at bootup.
37-
38-
If you are unsure how to answer this question, answer 1.
39-
4025
config SECURITY_SELINUX_DISABLE
4126
bool "NSA SELinux runtime disable"
4227
depends on SECURITY_SELINUX

‎security/selinux/hooks.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ __setup("enforcing=", enforcing_setup);
121121
#define selinux_enforcing_boot 1
122122
#endif
123123

124+
int selinux_enabled __lsm_ro_after_init = 1;
124125
#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
125-
int selinux_enabled = CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE;
126-
127126
static int __init selinux_enabled_setup(char *str)
128127
{
129128
unsigned long enabled;
@@ -132,8 +131,6 @@ static int __init selinux_enabled_setup(char *str)
132131
return 1;
133132
}
134133
__setup("selinux=", selinux_enabled_setup);
135-
#else
136-
int selinux_enabled = 1;
137134
#endif
138135

139136
static unsigned int selinux_checkreqprot_boot =

0 commit comments

Comments
 (0)