LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: linux-kernel@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org, Michal Marek <mmarek@suse.cz>,
David Howells <dhowells@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] modsign: provide option to automatically delete the key after modules were installed
Date: Sat, 18 Jul 2015 23:56:53 +0200 [thread overview]
Message-ID: <55AACBA5.6060602@ahsoftware.de> (raw)
In-Reply-To: <1421976009-9819-1-git-send-email-holler@ahsoftware.de>
Hello,
besides that calling rm on Linux is just snake oil, the patch below
still automatically hides the key used to sign modules and offers a
statistically good chance that the key sometimes might physically
disappear from the storage used to compile a kernel. So many people
still might consider it useful. As mentioned below, at least one well
known person seems to might find it useful too.
Should I rewrite the commit message (e.g. to nothing as the subject
already describes it perfectly) or is the chance to get such stuff from
someone outside the holy circles included already zero?
Sorry for asking (that way), but I'm curious if there is really zero
interest in it.
Regards,
Alexander Holler
Am 23.01.2015 um 02:20 schrieb Alexander Holler:
> I usually throw away (delete) the key used to sign modules after having
> called make -jN (b)zImage modules && make -jN modules_install. Because I've
> got bored to always have to type rm signing_key.* afterwards, I've build
> this patch some time ago.
> As I'm not eager anymore to publish kernel patches, it rested in my private
> chest of patches until I've seen the keynote of Linux.conf.au 2015. It made
> me aware that this patch might have a chance to become included. ;)
>
> Signed-off-by: Alexander Holler <holler@ahsoftware.de>
> ---
> Makefile | 7 +++++++
> init/Kconfig | 12 ++++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index fb93350..95e07ca 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1129,6 +1129,13 @@ _modinst_:
> @cp -f $(objtree)/modules.order $(MODLIB)/
> @cp -f $(objtree)/modules.builtin $(MODLIB)/
> $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
> +ifeq ($(CONFIG_MODULE_SIG_THROW_AWAY), y)
> + @echo "###"
> + @echo "### Deleting key used to sign modules."
> + @echo "###"
> + @rm ./signing_key.priv
> + @rm ./signing_key.x509
> +endif
>
> # This depmod is only for convenience to give the initial
> # boot a modules.dep even before / is mounted read-write. However the
> diff --git a/init/Kconfig b/init/Kconfig
> index 9afb971..f29304e 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1884,6 +1884,18 @@ config MODULE_SIG_ALL
> Sign all modules during make modules_install. Without this option,
> modules must be signed manually, using the scripts/sign-file tool.
>
> +config MODULE_SIG_THROW_AWAY
> + bool "Automatically delete the key after modules were installed"
> + default n
> + depends on MODULE_SIG_ALL
> + help
> + Delete the key used to sign modules after modules were installed.
> + Be aware of the consequences. The downside is that you won't be
> + able to build any module for a (maybe running) kernel, but will
> + have to rebuild the kernel and all modules in order to add or modify
> + a module. The upside is that you don't have to secure the key in
> + order to keep a running kernel safe from unwanted modules.
> +
> comment "Do not forget to sign required modules with scripts/sign-file"
> depends on MODULE_SIG_FORCE && !MODULE_SIG_ALL
>
>
prev parent reply other threads:[~2015-07-18 21:57 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 1:20 Alexander Holler
2015-01-23 9:24 ` Michal Marek
2015-01-23 9:39 ` Alexander Holler
2015-01-23 10:15 ` Alexander Holler
2015-01-23 10:55 ` Michal Marek
2015-01-23 11:43 ` Alexander Holler
2015-01-23 11:54 ` Alexander Holler
2015-01-23 12:34 ` Alexander Holler
2015-01-23 18:26 ` Alexander Holler
2015-01-23 12:56 ` David Howells
2015-01-23 13:27 ` Alexander Holler
2015-01-23 13:35 ` Alexander Holler
2015-01-23 21:57 ` [PATCH] modsign: overwrite keys with zero before deleting them Alexander Holler
2015-01-23 22:06 ` Richard Weinberger
2015-01-23 22:16 ` Alexander Holler
2015-01-23 23:58 ` David Howells
2015-01-24 0:13 ` Alexander Holler
2015-01-24 1:27 ` Pádraig Brady
2015-01-24 10:45 ` [PATCH v2] modsign: use shred to overwrite the private key before deleting it Alexander Holler
2015-01-24 11:37 ` Alexander Holler
2015-01-24 12:09 ` Alexander Holler
2015-01-24 12:29 ` Alexander Holler
2015-01-25 2:13 ` Pádraig Brady
2015-01-25 2:43 ` Alexander Holler
2015-01-25 10:32 ` Alexander Holler
2015-01-25 10:57 ` Alexander Holler
2015-01-25 11:42 ` Alexander Holler
2015-01-25 12:04 ` Alexander Holler
2015-01-25 12:08 ` Richard Weinberger
2015-01-25 12:24 ` Alexander Holler
2015-01-25 12:28 ` Richard Weinberger
2015-01-25 12:57 ` Alexander Holler
2015-01-25 12:36 ` Alexander Holler
2015-01-25 13:46 ` Alexander Holler
2015-01-29 22:39 ` Alexander Holler
2015-07-18 21:56 ` Alexander Holler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55AACBA5.6060602@ahsoftware.de \
--to=holler@ahsoftware.de \
--cc=dhowells@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=torvalds@linux-foundation.org \
--subject='Re: [PATCH] modsign: provide option to automatically delete the key after modules were installed' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).