Skip to content

Commit 0102fb8

Browse files
committed
apparmor: Remove SECURITY_APPARMOR_BOOTPARAM_VALUE
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>
1 parent 14bd99c commit 0102fb8

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

‎security/apparmor/Kconfig‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ config SECURITY_APPARMOR
1414

1515
If you are unsure how to answer this question, answer N.
1616

17-
config SECURITY_APPARMOR_BOOTPARAM_VALUE
18-
int "AppArmor boot parameter default value"
19-
depends on SECURITY_APPARMOR
20-
range 0 1
21-
default 1
22-
help
23-
This option sets the default value for the kernel parameter
24-
'apparmor', which allows AppArmor to be enabled or disabled
25-
at boot. If this option is set to 0 (zero), the AppArmor
26-
kernel parameter will default to 0, disabling AppArmor at
27-
boot. If this option is set to 1 (one), the AppArmor
28-
kernel parameter will default to 1, enabling AppArmor at
29-
boot.
30-
31-
If you are unsure how to answer this question, answer 1.
32-
3317
config SECURITY_APPARMOR_HASH
3418
bool "Enable introspection of sha1 hashes for loaded profiles"
3519
depends on SECURITY_APPARMOR

‎security/apparmor/lsm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ bool aa_g_paranoid_load = true;
13331333
module_param_named(paranoid_load, aa_g_paranoid_load, aabool, S_IRUGO);
13341334

13351335
/* Boot time disable flag */
1336-
static int apparmor_enabled = CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE;
1336+
static int apparmor_enabled __lsm_ro_after_init = 1;
13371337
module_param_named(enabled, apparmor_enabled, int, 0444);
13381338

13391339
static int __init apparmor_enabled_setup(char *str)

0 commit comments

Comments
 (0)