mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]>
Signed-off-by: Matthew Garrett <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Cc: Jessica Yu <[email protected]>
Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
000d388ed3
commit
49fcf732bd
5 changed files with 38 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
|||
config SECURITY_LOCKDOWN_LSM
|
||||
bool "Basic module for enforcing kernel lockdown"
|
||||
depends on SECURITY
|
||||
select MODULE_SIG if MODULES
|
||||
help
|
||||
Build support for an LSM that enforces a coarse kernel lockdown
|
||||
behaviour.
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
[LOCKDOWN_INTEGRITY_MAX] = "integrity",
|
||||
[LOCKDOWN_CONFIDENTIALITY_MAX] = "confidentiality",
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue