linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC v2 0/7] modsig: signature based kernel module integrity verfication
@ 2012-08-15 18:43 Dmitry Kasatkin
  2012-08-15 18:43 ` [RFC v2 1/7] integrity: added digest calculation function Dmitry Kasatkin
                   ` (6 more replies)
  0 siblings, 7 replies; 47+ messages in thread
From: Dmitry Kasatkin @ 2012-08-15 18:43 UTC (permalink / raw)
  To: zohar, jmorris, rusty, dhowells, linux-security-module, linux-kernel

Hello,

IMA measures/appraises modules when modprobe or insmod opens and reads them.
Unfortunately, there are no guarantees between what is read by userspace and
what is passed to the kernel via load_module system call. This patch adds
support for digital signature verification of kernel modules.

It uses the upstreamed digital signature verification support, which is also
used by IMA/EVM. There is no dependency on IMA/EVM, but both use the same
signature and key formats, defined by digital signature verification support.

These patches are intended to support the different use cases, from an
individual developer creating ephemeral keys, to the distro having an
existing signing mechanism in place.

For the distro, a well known public key can simply be embedded in the
kernel during the 'make' process.

For the developer, these patches create an ephemeral key during module
install, in order to limit the duration of the private key's existence.
Unfortunately, this necessitates embedding the public key in the kernel,
after the kernel has already been built.  A new make target called
'signed_modules_install', creates the keypair, signs the modules,
removes the private key, and then, for now, recompiles the kernel using
'make bzImage'.  For the developer, instead of doing 'make
modules_install', the new build process would be 'make', followed by
'make signed_modules_install' and 'make install'.

Scripts:
- new scripts/ksign.sh and scripts/genkey.sh scripts
- new targets signed_module_install and genkey for the top Makefile
- scripts/Makefile.modinst changes

Changelog v2:
- Replaces passing the signature as a separate argument, with appending
  the signature to the kernel module during module install, as suggested
  by Rusty Russell. (No module-init-tools changes required.)
- The signature is created during module install, after the module was
  possibly stripped.
- Added support for using a builtin public key. (No requirement for an
  initramfs to load the public key.)
- Added key creation and signing support to kernel Makefiles.
- Permits developers to conveniently sign their own modules with an
  ephemeral key using "make signed_modules_install".

- Dmitry & Mimi

Dmitry Kasatkin (4):
  integrity: added digest calculation function
  modsig: add integrity_module_check hook
  modsig: verify module integrity based on signature
  modsig: build rules and scripts to generate keys and sign modules

Mimi Zohar (3):
  keys: initialize root uid and session keyrings early
  integrity: create and inititialize a keyring with builtin public key
  modsig: initialize the _module public key keyring

 Makefile                           |   38 ++++++++++
 include/linux/integrity.h          |   10 +++
 kernel/module.c                    |    9 +++
 scripts/Makefile.modinst           |    1 +
 scripts/genkey.sh                  |  135 ++++++++++++++++++++++++++++++++++++
 scripts/ksign.sh                   |   64 +++++++++++++++++
 security/integrity/Kconfig         |   21 ++++++
 security/integrity/Makefile        |   18 +++++
 security/integrity/digsig.c        |   31 ++++++++-
 security/integrity/digsig_pubkey.c |   96 +++++++++++++++++++++++++
 security/integrity/integrity.h     |   13 ++++
 security/integrity/module.c        |   91 ++++++++++++++++++++++++
 security/keys/Makefile             |    1 +
 security/keys/root_keyring.c       |   18 +++++
 14 files changed, 544 insertions(+), 2 deletions(-)
 create mode 100755 scripts/genkey.sh
 create mode 100755 scripts/ksign.sh
 create mode 100644 security/integrity/digsig_pubkey.c
 create mode 100644 security/integrity/module.c
 create mode 100644 security/keys/root_keyring.c

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2012-09-04  5:58 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-15 18:43 [RFC v2 0/7] modsig: signature based kernel module integrity verfication Dmitry Kasatkin
2012-08-15 18:43 ` [RFC v2 1/7] integrity: added digest calculation function Dmitry Kasatkin
2012-08-15 20:11   ` Serge Hallyn
2012-08-15 21:11     ` Kasatkin, Dmitry
2012-08-16 20:32       ` Kasatkin, Dmitry
2012-08-16 21:39         ` Serge Hallyn
2012-08-20  2:59   ` Rusty Russell
2012-08-22 16:38     ` Kasatkin, Dmitry
2012-08-15 18:43 ` [RFC v2 2/7] keys: initialize root uid and session keyrings early Dmitry Kasatkin
2012-08-16 18:26   ` Josh Boyer
2012-08-16 19:08     ` Mimi Zohar
2012-08-16 19:13       ` Josh Boyer
2012-08-16 19:45         ` Mimi Zohar
2012-08-16 19:59           ` Josh Boyer
2012-08-16 20:01             ` Mimi Zohar
2012-08-17 21:27               ` Eric W. Biederman
2012-08-15 18:43 ` [RFC v2 3/7] integrity: create and inititialize a keyring with builtin public key Dmitry Kasatkin
2012-08-16 18:37   ` Josh Boyer
2012-08-16 19:28     ` Mimi Zohar
2012-08-17  6:06       ` Kasatkin, Dmitry
2012-08-16 21:11     ` Kasatkin, Dmitry
2012-08-15 18:43 ` [RFC v2 4/7] modsig: add integrity_module_check hook Dmitry Kasatkin
2012-08-15 20:16   ` Serge Hallyn
2012-08-15 21:13     ` Kasatkin, Dmitry
2012-08-17  5:45       ` Kasatkin, Dmitry
2012-08-16 18:49   ` Josh Boyer
2012-08-16 19:56     ` Kasatkin, Dmitry
2012-09-03 23:06   ` Rusty Russell
2012-08-15 18:43 ` [RFC v2 5/7] modsig: verify module integrity based on signature Dmitry Kasatkin
2012-08-15 18:43 ` [RFC v2 6/7] modsig: initialize the _module public key keyring Dmitry Kasatkin
2012-08-16 18:54   ` Josh Boyer
2012-08-16 19:57     ` Mimi Zohar
2012-08-15 18:43 ` [RFC v2 7/7] modsig: build rules and scripts to generate keys and sign modules Dmitry Kasatkin
2012-08-16 19:10   ` Josh Boyer
2012-08-16 20:12     ` Kasatkin, Dmitry
2012-08-16 20:31       ` Josh Boyer
2012-08-16 21:04         ` Kasatkin, Dmitry
2012-08-17  0:53           ` Mimi Zohar
2012-08-17 11:40             ` Josh Boyer
2012-08-17 17:08               ` Mimi Zohar
2012-08-17 17:44                 ` Josh Boyer
2012-08-17 17:52                   ` Josh Boyer
2012-08-20  1:05                   ` Mimi Zohar
2012-08-20 12:32                     ` Josh Boyer
2012-08-20 13:13                       ` Mimi Zohar
2012-08-20 14:23                         ` Josh Boyer
2012-08-16 20:12     ` Mimi Zohar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).