* [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression
@ 2024-05-14 22:48 Stephen Boyd
2024-05-14 22:52 ` Kees Cook
2024-05-18 20:47 ` Kees Cook
0 siblings, 2 replies; 4+ messages in thread
From: Stephen Boyd @ 2024-05-14 22:48 UTC (permalink / raw)
To: Kees Cook, Paul Moore, James Morris, Serge E . Hallyn
Cc: linux-kernel, patches, linux-security-module, Dmitry Torokhov,
Douglas Anderson
If modules are built compressed, and LoadPin is enforcing by default, we
must have in-kernel module decompression enabled (MODULE_DECOMPRESS).
Modules will fail to load without decompression built into the kernel
because they'll be blocked by LoadPin. Add a depends on clause to
prevent this combination.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
security/loadpin/Kconfig | 3 +++
1 file changed, 3 insertions(+)
diff --git a/security/loadpin/Kconfig b/security/loadpin/Kconfig
index 6724eaba3d36..8c22171088a7 100644
--- a/security/loadpin/Kconfig
+++ b/security/loadpin/Kconfig
@@ -14,6 +14,9 @@ config SECURITY_LOADPIN
config SECURITY_LOADPIN_ENFORCE
bool "Enforce LoadPin at boot"
depends on SECURITY_LOADPIN
+ # Module compression breaks LoadPin unless modules are decompressed in
+ # the kernel.
+ depends on MODULE_COMPRESS_NONE || MODULE_DECOMPRESS
help
If selected, LoadPin will enforce pinning at boot. If not
selected, it can be enabled at boot with the kernel parameter
base-commit: 4cece764965020c22cff7665b18a012006359095
--
https://chromeos.dev
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression
2024-05-14 22:48 [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression Stephen Boyd
@ 2024-05-14 22:52 ` Kees Cook
2024-05-18 20:47 ` Kees Cook
1 sibling, 0 replies; 4+ messages in thread
From: Kees Cook @ 2024-05-14 22:52 UTC (permalink / raw)
To: Paul Moore, James Morris, Serge E . Hallyn, Stephen Boyd
Cc: Kees Cook, linux-kernel, patches, linux-security-module,
Dmitry Torokhov, Douglas Anderson
On Tue, 14 May 2024 15:48:38 -0700, Stephen Boyd wrote:
> If modules are built compressed, and LoadPin is enforcing by default, we
> must have in-kernel module decompression enabled (MODULE_DECOMPRESS).
> Modules will fail to load without decompression built into the kernel
> because they'll be blocked by LoadPin. Add a depends on clause to
> prevent this combination.
>
>
> [...]
Applied to for-next/hardening, thanks!
[1/1] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression
https://git.kernel.org/kees/c/bc9316c14441
Take care,
--
Kees Cook
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression
2024-05-14 22:48 [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression Stephen Boyd
2024-05-14 22:52 ` Kees Cook
@ 2024-05-18 20:47 ` Kees Cook
2024-05-21 4:14 ` Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Kees Cook @ 2024-05-18 20:47 UTC (permalink / raw)
To: Stephen Boyd
Cc: Paul Moore, James Morris, Serge E . Hallyn, linux-kernel, patches,
linux-security-module, Dmitry Torokhov, Douglas Anderson
On Tue, May 14, 2024 at 03:48:38PM -0700, Stephen Boyd wrote:
> If modules are built compressed, and LoadPin is enforcing by default, we
> must have in-kernel module decompression enabled (MODULE_DECOMPRESS).
> Modules will fail to load without decompression built into the kernel
> because they'll be blocked by LoadPin. Add a depends on clause to
> prevent this combination.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
> security/loadpin/Kconfig | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/security/loadpin/Kconfig b/security/loadpin/Kconfig
> index 6724eaba3d36..8c22171088a7 100644
> --- a/security/loadpin/Kconfig
> +++ b/security/loadpin/Kconfig
> @@ -14,6 +14,9 @@ config SECURITY_LOADPIN
> config SECURITY_LOADPIN_ENFORCE
> bool "Enforce LoadPin at boot"
> depends on SECURITY_LOADPIN
> + # Module compression breaks LoadPin unless modules are decompressed in
> + # the kernel.
> + depends on MODULE_COMPRESS_NONE || MODULE_DECOMPRESS
> help
> If selected, LoadPin will enforce pinning at boot. If not
> selected, it can be enabled at boot with the kernel parameter
>
I've folded this change in, since loadpin also works in non-module
situations:
diff --git a/security/loadpin/Kconfig b/security/loadpin/Kconfig
index 8c22171088a7..848f8b4a6019 100644
--- a/security/loadpin/Kconfig
+++ b/security/loadpin/Kconfig
@@ -16,7 +16,7 @@ config SECURITY_LOADPIN_ENFORCE
depends on SECURITY_LOADPIN
# Module compression breaks LoadPin unless modules are decompressed in
# the kernel.
- depends on MODULE_COMPRESS_NONE || MODULE_DECOMPRESS
+ depends on !MODULES || (MODULE_COMPRESS_NONE || MODULE_DECOMPRESS)
help
If selected, LoadPin will enforce pinning at boot. If not
selected, it can be enabled at boot with the kernel parameter
--
Kees Cook
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression
2024-05-18 20:47 ` Kees Cook
@ 2024-05-21 4:14 ` Stephen Boyd
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2024-05-21 4:14 UTC (permalink / raw)
To: Kees Cook
Cc: Paul Moore, James Morris, Serge E . Hallyn, linux-kernel, patches,
linux-security-module, Dmitry Torokhov, Douglas Anderson
Quoting Kees Cook (2024-05-18 13:47:14)
> On Tue, May 14, 2024 at 03:48:38PM -0700, Stephen Boyd wrote:
> > If modules are built compressed, and LoadPin is enforcing by default, we
> > must have in-kernel module decompression enabled (MODULE_DECOMPRESS).
> > Modules will fail to load without decompression built into the kernel
> > because they'll be blocked by LoadPin. Add a depends on clause to
> > prevent this combination.
> >
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Cc: Douglas Anderson <dianders@chromium.org>
> > Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> > ---
> > security/loadpin/Kconfig | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/security/loadpin/Kconfig b/security/loadpin/Kconfig
> > index 6724eaba3d36..8c22171088a7 100644
> > --- a/security/loadpin/Kconfig
> > +++ b/security/loadpin/Kconfig
> > @@ -14,6 +14,9 @@ config SECURITY_LOADPIN
> > config SECURITY_LOADPIN_ENFORCE
> > bool "Enforce LoadPin at boot"
> > depends on SECURITY_LOADPIN
> > + # Module compression breaks LoadPin unless modules are decompressed in
> > + # the kernel.
> > + depends on MODULE_COMPRESS_NONE || MODULE_DECOMPRESS
> > help
> > If selected, LoadPin will enforce pinning at boot. If not
> > selected, it can be enabled at boot with the kernel parameter
> >
>
> I've folded this change in, since loadpin also works in non-module
> situations:
Thanks for fixing my thinko.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-05-21 4:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 22:48 [PATCH] loadpin: Prevent SECURITY_LOADPIN_ENFORCE=y without module decompression Stephen Boyd
2024-05-14 22:52 ` Kees Cook
2024-05-18 20:47 ` Kees Cook
2024-05-21 4:14 ` Stephen Boyd
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.