x86/ima: require signed kernel modules
authorMimi Zohar <zohar@linux.ibm.com>
Mon, 28 Jan 2019 00:03:45 +0000 (19:03 -0500)
committerMimi Zohar <zohar@linux.ibm.com>
Wed, 27 Mar 2019 14:36:44 +0000 (10:36 -0400)
commit8db5da0b8618df79eceea99672e205d4a2a6309e
tree0c2f55e5fc3827130bc7a9b389fde8c4d24261b2
parent8d93e952fba216cd0811247f6360d97e0465d5fc
x86/ima: require signed kernel modules

Have the IMA architecture specific policy require signed kernel modules
on systems with secure boot mode enabled; and coordinate the different
signature verification methods, so only one signature is required.

Requiring appended kernel module signatures may be configured, enabled
on the boot command line, or with this patch enabled in secure boot
mode.  This patch defines set_module_sig_enforced().

To coordinate between appended kernel module signatures and IMA
signatures, only define an IMA MODULE_CHECK policy rule if
CONFIG_MODULE_SIG is not enabled.  A custom IMA policy may still define
and require an IMA signature.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
arch/x86/kernel/ima_arch.c
include/linux/module.h
kernel/module.c