From: Paul Moore <paul@paul-moore.com>
To: Song Liu <song@kernel.org>, linux-security-module@vger.kernel.org
Cc: jmorris@namei.org, serge@hallyn.com, kernel-team@meta.com,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Song Liu <song@kernel.org>
Subject: Re: [PATCH] lsm: make SECURITY_PATH always enabled
Date: Tue, 22 Apr 2025 15:53:17 -0400 [thread overview]
Message-ID: <973cedc0d38496b2096992bf68c72e67@paul-moore.com> (raw)
In-Reply-To: <20250422184407.3257964-1-song@kernel.org>
On Apr 22, 2025 Song Liu <song@kernel.org> wrote:
>
> Only TOMOYO needed CONFIG_SECURITY_PATH when it was introduced. But now,
> AppArmor, EVM, IMA and LandLock also need it. And kernels are likely built
> with at least one of these enabled if CONFIG_SECURITY is enabled. Let's
> simplify the dependency.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Signed-off-by: Song Liu <song@kernel.org>
> ---
> This was initially proposed in [1], but got Nacked by Paul.
I chose not to merge the patch with the following comment:
"If a Kconfig option is only needed by a subset of LSMs, which is the
case for CONFIG_SECURITY_PATH, it should remain a build-time option."
... and that reasoning still sounds reasonable to me today.
> ... but it is really up to the LSMs to decide how
> they use struct path.
LSMs are currently free to select CONFIG_SECURITY_PATH as needed. In
fact, if you look any modern Linux tree you'll see that TOMOYO, AppArmor,
Landlock, IMA, and EVM all select CONFIG_SECURITY_PATH based on their
individual Kconfig settings.
> The separation of CONFIG_SECURITY and CONFIG_SECURITY_PATH has actually
> caused confusion. In some of our early kernels, we enabled CONFIG_SECURITY
> but not CONFIG_SECURITY_PATH. Now, we have to add separate logic in user
> space to deal with missing CONFIG_SECURITY_PATH in these systems.
I'm sorry that you made some Kconfig choices on a production kernel that
you now regret, but that doesn't change things from an upstream
perspective. The exception of course would be if there was a LSM that
*required* CONFIG_SECURITY_PATH but did not enable it or mark it as a
dependency in the LSM's Kconfig. It doesn't sound like that is the case
here, but please let me know if that was the root cause so we can work
with the individual LSM to fix the associated Kconfig.
As you likely know, the LSM subsystem as a whole (framework and
individual LSMs) is often criticized over various performance impacts;
one of the easiest ways to limit the impact of the LSM on overall system
performance is to remove LSM hooks that are not needed. Keeping the
CONFIG_SECURITY_PATH hooks as-is and allowing individual LSMs to opt-in
as needed is a reasonable balance between providing the necessary LSM
hook support and limiting performance impacts.
--
paul-moore.com
next prev parent reply other threads:[~2025-04-22 19:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 18:44 [PATCH] lsm: make SECURITY_PATH always enabled Song Liu
2025-04-22 19:53 ` Paul Moore [this message]
2025-04-22 20:31 ` Song Liu
2025-04-22 21:13 ` Paul Moore
2025-04-23 4:57 ` Song Liu
2025-04-23 14:58 ` Paul Moore
2025-04-23 20:54 ` Song Liu
2025-04-23 21:23 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=973cedc0d38496b2096992bf68c72e67@paul-moore.com \
--to=paul@paul-moore.com \
--cc=jmorris@namei.org \
--cc=kernel-team@meta.com \
--cc=linux-security-module@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=serge@hallyn.com \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox