diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2012-09-26 11:09:40 +0200 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2012-10-10 11:30:55 +0200 |
commit | 106a4ee258d14818467829bf0e12aeae14c16cd7 (patch) | |
tree | 4a5d002eceff4a028ebc8d88223b1ed735bee224 /include | |
parent | X.509: Add a crypto key parser for binary (DER) X.509 certificates (diff) | |
download | linux-106a4ee258d14818467829bf0e12aeae14c16cd7.tar.xz linux-106a4ee258d14818467829bf0e12aeae14c16cd7.zip |
module: signature checking hook
We do a very simple search for a particular string appended to the module
(which is cache-hot and about to be SHA'd anyway). There's both a config
option and a boot parameter which control whether we accept or fail with
unsigned modules and modules that are signed with an unknown key.
If module signing is enabled, the kernel will be tainted if a module is
loaded that is unsigned or has a signature for which we don't have the
key.
(Useful feedback and tweaks by David Howells <dhowells@redhat.com>)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/module.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/module.h b/include/linux/module.h index fbcafe2ee13e..7760c6d344a3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -21,6 +21,9 @@ #include <linux/percpu.h> #include <asm/module.h> +/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */ +#define MODULE_SIG_STRING "~Module signature appended~\n" + /* Not Yet Implemented */ #define MODULE_SUPPORTED_DEVICE(name) @@ -260,6 +263,11 @@ struct module const unsigned long *unused_gpl_crcs; #endif +#ifdef CONFIG_MODULE_SIG + /* Signature was verified. */ + bool sig_ok; +#endif + /* symbols that will be GPL-only in the near future. */ const struct kernel_symbol *gpl_future_syms; const unsigned long *gpl_future_crcs; |