linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] LSM: Ignore "security=" when "lsm=" is specified
@ 2019-02-11 22:54 Kees Cook
  2019-02-11 23:10 ` Casey Schaufler
  2019-02-12  0:21 ` Tetsuo Handa
  0 siblings, 2 replies; 8+ messages in thread
From: Kees Cook @ 2019-02-11 22:54 UTC (permalink / raw)
  To: James Morris; +Cc: linux-security-module, Tetsuo Handa, linux-kernel

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>
---
 security/security.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/security/security.c b/security/security.c
index 3147785e20d7..e6153ed54361 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 of 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++)
-- 
2.17.1


-- 
Kees Cook

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-02-12 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 22:54 [PATCH] LSM: Ignore "security=" when "lsm=" is specified Kees Cook
2019-02-11 23:10 ` Casey Schaufler
2019-02-11 23:18   ` Kees Cook
2019-02-12  0:07     ` James Morris
2019-02-12  0:21 ` Tetsuo Handa
2019-02-12  0:26   ` Kees Cook
2019-02-12  0:59     ` Tetsuo Handa
2019-02-12 18:26       ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).