path: root/security/lockdown
diff options
authorDavid Howells <>2019-08-19 17:17:40 -0700
committerJames Morris <>2019-08-19 21:54:15 -0700
commit49fcf732bdae0550721ef73af7c45109ce26b2a9 (patch)
treecdf90d95cc5fb01413ac3c83f51796c1c3a0cdec /security/lockdown
parent000d388ed3bbed745f366ce71b2bb7c2ee70f449 (diff)
lockdown: Enforce module signatures if the kernel is locked down
If the kernel is locked down, require that all modules have valid signatures that we can verify. I have adjusted the errors generated: (1) If there's no signature (ENODATA) or we can't check it (ENOPKG, ENOKEY), then: (a) If signatures are enforced then EKEYREJECTED is returned. (b) If there's no signature or we can't check it, but the kernel is locked down then EPERM is returned (this is then consistent with other lockdown cases). (2) If the signature is unparseable (EBADMSG, EINVAL), the signature fails the check (EKEYREJECTED) or a system error occurs (eg. ENOMEM), we return the error we got. Note that the X.509 code doesn't check for key expiry as the RTC might not be valid or might not have been transferred to the kernel's clock yet. [Modified by Matthew Garrett to remove the IMA integration. This will be replaced with integration with the IMA architecture policy patchset.] Signed-off-by: David Howells <> Signed-off-by: Matthew Garrett <> Reviewed-by: Kees Cook <> Cc: Jessica Yu <> Signed-off-by: James Morris <>
Diffstat (limited to 'security/lockdown')
2 files changed, 2 insertions, 0 deletions
diff --git a/security/lockdown/Kconfig b/security/lockdown/Kconfig
index 7a1d213227a4..e84ddf484010 100644
--- a/security/lockdown/Kconfig
+++ b/security/lockdown/Kconfig
@@ -1,6 +1,7 @@
bool "Basic module for enforcing kernel lockdown"
depends on SECURITY
Build support for an LSM that enforces a coarse kernel lockdown
diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
index 7172ad75496b..d8e42125a5dd 100644
--- a/security/lockdown/lockdown.c
+++ b/security/lockdown/lockdown.c
@@ -18,6 +18,7 @@ static enum lockdown_reason kernel_locked_down;
static char *lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = {
[LOCKDOWN_NONE] = "none",
+ [LOCKDOWN_MODULE_SIGNATURE] = "unsigned module loading",