apparmor: Remove SECURITY_APPARMOR_BOOTPARAM_VALUE
authorKees Cook <keescook@chromium.org>
Tue, 2 Oct 2018 00:08:57 +0000 (17:08 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 8 Jan 2019 21:18:43 +0000 (13:18 -0800)
In preparation for removing CONFIG_DEFAULT_SECURITY, this removes the
soon-to-be redundant SECURITY_APPARMOR_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=apparmor", the enable
variable defaults to true.

Signed-off-by: Kees Cook <keescook@chromium.org>
security/apparmor/Kconfig
security/apparmor/lsm.c

index b6b68a7750ce36597ecba044f82385c8e6efc71f..3de21f46c82af95176f379c5fb4c22d721bbd82d 100644 (file)
@@ -14,22 +14,6 @@ config SECURITY_APPARMOR
 
          If you are unsure how to answer this question, answer N.
 
-config SECURITY_APPARMOR_BOOTPARAM_VALUE
-       int "AppArmor boot parameter default value"
-       depends on SECURITY_APPARMOR
-       range 0 1
-       default 1
-       help
-         This option sets the default value for the kernel parameter
-         'apparmor', which allows AppArmor to be enabled or disabled
-          at boot.  If this option is set to 0 (zero), the AppArmor
-         kernel parameter will default to 0, disabling AppArmor at
-         boot.  If this option is set to 1 (one), the AppArmor
-         kernel parameter will default to 1, enabling AppArmor at
-         boot.
-
-         If you are unsure how to answer this question, answer 1.
-
 config SECURITY_APPARMOR_HASH
        bool "Enable introspection of sha1 hashes for loaded profiles"
        depends on SECURITY_APPARMOR
index 149a3e16b5da2c4f78168fbd7b0362b26d35467d..cda345767cfc4cc4e200188fbe895ba7632d75cd 100644 (file)
@@ -1333,7 +1333,7 @@ bool aa_g_paranoid_load = true;
 module_param_named(paranoid_load, aa_g_paranoid_load, aabool, S_IRUGO);
 
 /* Boot time disable flag */
-static int apparmor_enabled = CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE;
+static int apparmor_enabled __lsm_ro_after_init = 1;
 module_param_named(enabled, apparmor_enabled, int, 0444);
 
 static int __init apparmor_enabled_setup(char *str)