summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-02-12 19:23:18 +0100
committerJames Morris <james.morris@microsoft.com>2019-02-26 00:22:48 +0100
commit89a9684ea158dd7eef1728be9f0aed9a7d41cf19 (patch)
treefaeed122fb3f70e927d14d7a587a5c634a0cbaf9 /security
parentLSM: Update function documentation for cap_capable (diff)
downloadlinux-89a9684ea158dd7eef1728be9f0aed9a7d41cf19.tar.xz
linux-89a9684ea158dd7eef1728be9f0aed9a7d41cf19.zip
LSM: Ignore "security=" when "lsm=" is specified
To avoid potential confusion, explicitly ignore "security=" when "lsm=" is used on the command line, and report that it is happening. Suggested-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Casey Schaufler <casey@schaufler-ca.com> Acked-by: John Johansen <john.johansen@canonical.com> Signed-off-by: James Morris <james.morris@microsoft.com>
Diffstat (limited to 'security')
-rw-r--r--security/security.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/security/security.c b/security/security.c
index b6bff646d373..ed9b8cbf21cf 100644
--- a/security/security.c
+++ b/security/security.c
@@ -288,9 +288,13 @@ static void __init ordered_lsm_init(void)
ordered_lsms = kcalloc(LSM_COUNT + 1, sizeof(*ordered_lsms),
GFP_KERNEL);
- if (chosen_lsm_order)
+ if (chosen_lsm_order) {
+ if (chosen_major_lsm) {
+ pr_info("security= is ignored because it is superseded by lsm=\n");
+ chosen_major_lsm = NULL;
+ }
ordered_lsm_parse(chosen_lsm_order, "cmdline");
- else
+ } else
ordered_lsm_parse(builtin_lsm_order, "builtin");
for (lsm = ordered_lsms; *lsm; lsm++)