aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/Kconfig32
-rw-r--r--security/security.c9
2 files changed, 38 insertions, 3 deletions
diff --git a/security/Kconfig b/security/Kconfig
index aeea8c2bb59c..95cc08913ca1 100644
--- a/security/Kconfig
+++ b/security/Kconfig
@@ -152,5 +152,37 @@ source security/tomoyo/Kconfig
152 152
153source security/integrity/ima/Kconfig 153source security/integrity/ima/Kconfig
154 154
155choice
156 prompt "Default security module"
157 default DEFAULT_SECURITY_SELINUX if SECURITY_SELINUX
158 default DEFAULT_SECURITY_SMACK if SECURITY_SMACK
159 default DEFAULT_SECURITY_TOMOYO if SECURITY_TOMOYO
160 default DEFAULT_SECURITY_DAC
161
162 help
163 Select the security module that will be used by default if the
164 kernel parameter security= is not specified.
165
166 config DEFAULT_SECURITY_SELINUX
167 bool "SELinux" if SECURITY_SELINUX=y
168
169 config DEFAULT_SECURITY_SMACK
170 bool "Simplified Mandatory Access Control" if SECURITY_SMACK=y
171
172 config DEFAULT_SECURITY_TOMOYO
173 bool "TOMOYO" if SECURITY_TOMOYO=y
174
175 config DEFAULT_SECURITY_DAC
176 bool "Unix Discretionary Access Controls"
177
178endchoice
179
180config DEFAULT_SECURITY
181 string
182 default "selinux" if DEFAULT_SECURITY_SELINUX
183 default "smack" if DEFAULT_SECURITY_SMACK
184 default "tomoyo" if DEFAULT_SECURITY_TOMOYO
185 default "" if DEFAULT_SECURITY_DAC
186
155endmenu 187endmenu
156 188
diff --git a/security/security.c b/security/security.c
index 684d5ee655da..aad71b2ca195 100644
--- a/security/security.c
+++ b/security/security.c
@@ -19,7 +19,8 @@
19#include <linux/ima.h> 19#include <linux/ima.h>
20 20
21/* Boot-time LSM user choice */ 21/* Boot-time LSM user choice */
22static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1]; 22static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
23 CONFIG_DEFAULT_SECURITY;
23 24
24/* things that live in capability.c */ 25/* things that live in capability.c */
25extern struct security_operations default_security_ops; 26extern struct security_operations default_security_ops;
@@ -80,8 +81,10 @@ __setup("security=", choose_lsm);
80 * 81 *
81 * Return true if: 82 * Return true if:
82 * -The passed LSM is the one chosen by user at boot time, 83 * -The passed LSM is the one chosen by user at boot time,
83 * -or user didn't specify a specific LSM and we're the first to ask 84 * -or the passed LSM is configured as the default and the user did not
84 * for registration permission, 85 * choose an alternate LSM at boot time,
86 * -or there is no default LSM set and the user didn't specify a
87 * specific LSM and we're the first to ask for registration permission,
85 * -or the passed LSM is currently loaded. 88 * -or the passed LSM is currently loaded.
86 * Otherwise, return false. 89 * Otherwise, return false.
87 */ 90 */