You can obtain the policy compiler (checkpolicy), the utility for
labeling filesystems (setfiles), and an example policy configuration
from http://www.nsa.gov/selinux.
- SELinux needs to be explicitly enabled on the kernel command line with
- selinux=1. If you specify selinux=0 or do not use this parameter,
- SELinux will not be enabled.
+ If you are unsure how to answer this question, answer N.
+
+config SECURITY_SELINUX_BOOTPARAM
+ bool "NSA SELinux boot parameter"
+ depends on SECURITY_SELINUX
+ default n
+ help
+ This option adds a kernel parameter 'selinux', which allows SELinux
+ to be disabled at boot. If this option is selected, SELinux
+ functionality can be disabled with selinux=0 on the kernel
+ command line. The purpose of this option is to allow a single
+ kernel image to be distributed with SELinux built in, but not
+ necessarily enabled.
+
If you are unsure how to answer this question, answer N.
config SECURITY_SELINUX_DEVELOP
__setup("enforcing=", enforcing_setup);
#endif
-int selinux_enabled = 0;
+#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
+int selinux_enabled = 1;
static int __init selinux_enabled_setup(char *str)
{
return 1;
}
__setup("selinux=", selinux_enabled_setup);
+#endif
/* Original (dummy) security module. */
static struct security_operations *original_ops = NULL;
struct task_security_struct *tsec;
if (!selinux_enabled) {
- printk(KERN_INFO "SELinux: Not enabled at boot.\n");
+ printk(KERN_INFO "SELinux: Disabled at boot.\n");
return 0;
}
#define SELINUX_MAGIC 0xf97cff8c
+#ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
+extern int selinux_enabled;
+#else
+#define selinux_enabled 1
+#endif
+
int security_load_policy(void * data, size_t len);
struct av_decision {