All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
@ 2019-02-12 18:23 Kees Cook
  2019-02-13 16:05 ` Casey Schaufler
  2019-02-25 23:23 ` James Morris
  0 siblings, 2 replies; 8+ messages in thread
From: Kees Cook @ 2019-02-12 18:23 UTC (permalink / raw)
  To: James Morris; +Cc: Tetsuo Handa, linux-security-module, 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>
---
 Documentation/admin-guide/kernel-parameters.txt | 10 ++++------
 security/security.c                             |  8 ++++++--
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 93d2c97f28fe..a0abd5f56e00 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2340,7 +2340,7 @@
 
 	lsm=lsm1,...,lsmN
 			[SECURITY] Choose order of LSM initialization. This
-			overrides CONFIG_LSM.
+			overrides CONFIG_LSM, and the "security=" parameter.
 
 	machvec=	[IA-64] Force the use of a particular machine-vector
 			(machvec) in a generic kernel.
@@ -4129,11 +4129,9 @@
 			Note: increases power consumption, thus should only be
 			enabled if running jitter sensitive (HPC/RT) workloads.
 
-	security=	[SECURITY] Choose a security module to enable at boot.
-			If this boot parameter is not specified, only the first
-			security module asking for security registration will be
-			loaded. An invalid security module name will be treated
-			as if no module has been chosen.
+	security=	[SECURITY] Choose a legacy "major" security module to
+			enable at boot. This has been deprecated by the
+			"lsm=" parameter.
 
 	selinux=	[SELINUX] Disable or enable SELinux at boot time.
 			Format: { "0" | "1" }
diff --git a/security/security.c b/security/security.c
index 3147785e20d7..23cbb1a295a3 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++)
-- 
2.17.1


-- 
Kees Cook

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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-12 18:23 [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified Kees Cook
@ 2019-02-13 16:05 ` Casey Schaufler
  2019-02-17  5:16   ` Tetsuo Handa
  2019-02-25 23:23 ` James Morris
  1 sibling, 1 reply; 8+ messages in thread
From: Casey Schaufler @ 2019-02-13 16:05 UTC (permalink / raw)
  To: Kees Cook, James Morris; +Cc: Tetsuo Handa, linux-security-module, linux-kernel

On 2/12/2019 10:23 AM, Kees Cook wrote:
> 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>

> ---
>  Documentation/admin-guide/kernel-parameters.txt | 10 ++++------
>  security/security.c                             |  8 ++++++--
>  2 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 93d2c97f28fe..a0abd5f56e00 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -2340,7 +2340,7 @@
>  
>  	lsm=lsm1,...,lsmN
>  			[SECURITY] Choose order of LSM initialization. This
> -			overrides CONFIG_LSM.
> +			overrides CONFIG_LSM, and the "security=" parameter.
>  
>  	machvec=	[IA-64] Force the use of a particular machine-vector
>  			(machvec) in a generic kernel.
> @@ -4129,11 +4129,9 @@
>  			Note: increases power consumption, thus should only be
>  			enabled if running jitter sensitive (HPC/RT) workloads.
>  
> -	security=	[SECURITY] Choose a security module to enable at boot.
> -			If this boot parameter is not specified, only the first
> -			security module asking for security registration will be
> -			loaded. An invalid security module name will be treated
> -			as if no module has been chosen.
> +	security=	[SECURITY] Choose a legacy "major" security module to
> +			enable at boot. This has been deprecated by the
> +			"lsm=" parameter.
>  
>  	selinux=	[SELINUX] Disable or enable SELinux at boot time.
>  			Format: { "0" | "1" }
> diff --git a/security/security.c b/security/security.c
> index 3147785e20d7..23cbb1a295a3 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++)

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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-13 16:05 ` Casey Schaufler
@ 2019-02-17  5:16   ` Tetsuo Handa
  2019-02-18  2:45     ` Paul Moore
  2019-02-21 13:12     ` Tetsuo Handa
  0 siblings, 2 replies; 8+ messages in thread
From: Tetsuo Handa @ 2019-02-17  5:16 UTC (permalink / raw)
  To: SELinux, kernel-team
  Cc: Casey Schaufler, Kees Cook, James Morris, linux-security-module,
	linux-kernel

On 2019/02/14 1:05, Casey Schaufler wrote:
> On 2/12/2019 10:23 AM, Kees Cook wrote:
>> 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>
> 

The manual for TOMOYO was updated to follow this change.
SELinux folks and AppArmor folks, can we apply this change?

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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-17  5:16   ` Tetsuo Handa
@ 2019-02-18  2:45     ` Paul Moore
  2019-02-18  3:57       ` Kees Cook
  2019-02-21 13:12     ` Tetsuo Handa
  1 sibling, 1 reply; 8+ messages in thread
From: Paul Moore @ 2019-02-18  2:45 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: SELinux, kernel-team, Casey Schaufler, Kees Cook, James Morris,
	linux-security-module, linux-kernel

On Sun, Feb 17, 2019 at 12:17 AM Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> On 2019/02/14 1:05, Casey Schaufler wrote:
> > On 2/12/2019 10:23 AM, Kees Cook wrote:
> >> 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>
>
> The manual for TOMOYO was updated to follow this change.
> SELinux folks and AppArmor folks, can we apply this change?

My main concern is that "selinux={0|1}" continues to work as it has
for years.  It doesn't look like this affects that, but I can't say
I've dug into these changes very far.

-- 
paul moore
www.paul-moore.com

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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-18  2:45     ` Paul Moore
@ 2019-02-18  3:57       ` Kees Cook
  0 siblings, 0 replies; 8+ messages in thread
From: Kees Cook @ 2019-02-18  3:57 UTC (permalink / raw)
  To: Paul Moore
  Cc: Tetsuo Handa, SELinux, Ubuntu Kernel Team, Casey Schaufler,
	James Morris, linux-security-module, LKML

On Sun, Feb 17, 2019 at 6:46 PM Paul Moore <paul@paul-moore.com> wrote:
> My main concern is that "selinux={0|1}" continues to work as it has
> for years.  It doesn't look like this affects that, but I can't say
> I've dug into these changes very far.

Yup, no worries; it does. :)

-- 
Kees Cook

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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-17  5:16   ` Tetsuo Handa
  2019-02-18  2:45     ` Paul Moore
@ 2019-02-21 13:12     ` Tetsuo Handa
  2019-02-22 10:00       ` John Johansen
  1 sibling, 1 reply; 8+ messages in thread
From: Tetsuo Handa @ 2019-02-21 13:12 UTC (permalink / raw)
  To: John Johansen
  Cc: Casey Schaufler, Kees Cook, James Morris, linux-security-module,
	apparmor

On 2019/02/17 14:16, Tetsuo Handa wrote:
> On 2019/02/14 1:05, Casey Schaufler wrote:
>> On 2/12/2019 10:23 AM, Kees Cook wrote:
>>> 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>
>>
> 
> The manual for TOMOYO was updated to follow this change.
> SELinux folks and AppArmor folks, can we apply this change?
> 

No response from Ubuntu kernel team. Redirecting to AppArmor list...

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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-21 13:12     ` Tetsuo Handa
@ 2019-02-22 10:00       ` John Johansen
  0 siblings, 0 replies; 8+ messages in thread
From: John Johansen @ 2019-02-22 10:00 UTC (permalink / raw)
  To: Tetsuo Handa
  Cc: Casey Schaufler, Kees Cook, James Morris, linux-security-module,
	apparmor

On 2/21/19 5:12 AM, Tetsuo Handa wrote:
> On 2019/02/17 14:16, Tetsuo Handa wrote:
>> On 2019/02/14 1:05, Casey Schaufler wrote:
>>> On 2/12/2019 10:23 AM, Kees Cook wrote:
>>>> 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>
>>>
>>
>> The manual for TOMOYO was updated to follow this change.
>> SELinux folks and AppArmor folks, can we apply this change?
>>
> 
> No response from Ubuntu kernel team. Redirecting to AppArmor list...
> 

yeah this is okay

Acked-by: John Johansen <john.johansen@canonical.com>


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

* Re: [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified
  2019-02-12 18:23 [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified Kees Cook
  2019-02-13 16:05 ` Casey Schaufler
@ 2019-02-25 23:23 ` James Morris
  1 sibling, 0 replies; 8+ messages in thread
From: James Morris @ 2019-02-25 23:23 UTC (permalink / raw)
  To: Kees Cook; +Cc: Tetsuo Handa, linux-security-module, linux-kernel

On Tue, 12 Feb 2019, Kees Cook wrote:

> 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>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general



-- 
James Morris
<jmorris@namei.org>


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

end of thread, other threads:[~2019-02-25 23:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 18:23 [PATCH v2] LSM: Ignore "security=" when "lsm=" is specified Kees Cook
2019-02-13 16:05 ` Casey Schaufler
2019-02-17  5:16   ` Tetsuo Handa
2019-02-18  2:45     ` Paul Moore
2019-02-18  3:57       ` Kees Cook
2019-02-21 13:12     ` Tetsuo Handa
2019-02-22 10:00       ` John Johansen
2019-02-25 23:23 ` James Morris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.