From: David Howells <dhowells@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: dhowells@redhat.com, Andy Lutomirski <luto@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Michal Marek <mmarek@suse.cz>,
David Woodhouse <dwmw2@infradead.org>,
Abelardo Ricart III <aricart@memnix.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Sedat Dilek <sedat.dilek@gmail.com>,
keyrings@linux-nfs.org, Rusty Russell <rusty@rustcorp.com.au>,
LSM List <linux-security-module@vger.kernel.org>,
Borislav Petkov <bp@alien8.de>, Jiri Kosina <jkosina@suse.cz>
Subject: Re: Should we automatically generate a module signing key at all?
Date: Tue, 19 May 2015 16:30:17 +0100 [thread overview]
Message-ID: <1752.1432049417@warthog.procyon.org.uk> (raw)
In-Reply-To: <CALCETrWSk+ruOzPFpiRj43kLvu_Pt8q2gZdbcu_hLsvdBQ84vw@mail.gmail.com>
Andy Lutomirski <luto@amacapital.net> wrote:
> I'll assume that everyone uses a 256-bit hash.
UEFI makes it very likely that SHA256 is in use, at least on x86_64.
> The public key is tiny, and the signature is 512 bytes per module.
> (Actually, it's probably more because of PKCS garbage.
There is metadata selecting the particular key to be checked against, so with
a 512-byte signature, you get around 500 bytes of metadata and ASN.1
wrappings. We could probably trim that some more by removing PKCS#7 attribute
sections.
We do have to allow people to load external modules. Yes, you could argue
that you should just disable all your security systems if you want to do
that...
> This is a total of ~21kB of non-swappable storage and 2MB of disk space for
> all the signatures.
Disk space is a lot cheaper than RAM.
> Ed25519
Is it endorsed by various governmental authorities? It's not entirely clear.
And also the aforementioned authorities may mandate minimum key (eg. 2048) and
digest sizes (eg. 256) which we need to deal with.
> With the hash-based scheme I outlined, the kernel text needed is
> nearly zero.
What matters is kernel text *plus* kernel data.
> What integrity stuff? IIRC dm-verity doesn't use asymmetric crypto at
> all. IMA probably does, though.
IMA.
> For firmware validation, there's no good reason it couldn't work exactly
> like module signatures.
That's really impractical. It would mean that the kernel would have to be
built with a hash, grand-hash, great-grand-hash or whatever that covers every
possible firmware blob you might want to load.
If a vendor releases a new firmware blob, this has to be added to the
linux-firmware hash list, say, then the hash of that added to the kernel, say,
and the kernel rebuilt and reissued before the firmware blob can be used.
With a key-based approach, you just need to get a signature for the new
firmware blob. You can even sign it yourself and add your key to your UEFI
database.
> For kexec, I think that the main use is for crash dumps
We also want to be able to kexec new kernels on servers to avoid heavy duty
hardware reboot cycles. But you can't put the new kernel's hash in the old
kernel.
David
next prev parent reply other threads:[~2015-05-19 15:30 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 16:04 Should we automatically generate a module signing key at all? David Howells
2015-05-18 16:19 ` David Woodhouse
2015-05-18 16:22 ` Linus Torvalds
2015-05-18 16:55 ` David Woodhouse
2015-05-18 16:20 ` Linus Torvalds
2015-05-19 0:51 ` Andy Lutomirski
2015-05-19 7:42 ` David Woodhouse
2015-05-19 8:53 ` David Howells
2015-05-19 12:46 ` David Woodhouse
2015-05-19 12:52 ` David Howells
2015-05-19 14:36 ` Andy Lutomirski
2015-05-19 15:30 ` David Howells [this message]
2015-05-19 15:55 ` Theodore Ts'o
2015-05-19 16:09 ` Petko Manolov
2015-05-19 16:23 ` David Howells
2015-05-19 17:55 ` Theodore Ts'o
2015-05-19 18:10 ` David Howells
2015-05-19 21:47 ` Jiri Kosina
2015-05-20 7:45 ` Michal Marek
2015-05-20 7:47 ` Michal Marek
2015-05-19 17:32 ` Mimi Zohar
2015-05-19 17:43 ` Andy Lutomirski
2015-05-19 17:53 ` Linus Torvalds
2015-05-19 17:17 ` Andy Lutomirski
2015-05-19 18:38 ` David Howells
2015-05-19 18:46 ` Andy Lutomirski
2015-05-19 18:50 ` David Howells
2015-05-19 18:57 ` David Howells
2015-05-19 19:06 ` Andy Lutomirski
2015-05-21 15:59 ` David Howells
2015-05-19 15:37 ` Mimi Zohar
2015-05-19 15:53 ` Petko Manolov
2015-05-19 17:17 ` Andy Lutomirski
2015-05-19 17:44 ` Linus Torvalds
2015-05-19 17:58 ` Andy Lutomirski
2015-05-19 18:01 ` Linus Torvalds
2015-05-19 18:08 ` David Woodhouse
2015-05-19 18:12 ` Andy Lutomirski
2015-05-19 18:38 ` David Woodhouse
2015-05-19 18:49 ` Andy Lutomirski
2015-05-19 20:00 ` David Woodhouse
2015-05-19 20:05 ` Andy Lutomirski
2015-05-19 20:25 ` David Woodhouse
2015-05-19 18:44 ` David Howells
2015-05-19 19:01 ` Andy Lutomirski
2015-05-21 16:10 ` David Howells
2015-05-21 16:50 ` Andy Lutomirski
2015-06-23 20:37 ` Pavel Machek
2015-05-20 5:01 ` Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2015-05-21 23:54 George Spelvin
2015-05-22 0:03 ` Linus Torvalds
2015-05-22 0:10 ` Andy Lutomirski
2015-05-22 14:13 ` George Spelvin
2015-05-22 20:40 ` Linus Torvalds
2015-05-22 20:44 ` Andy Lutomirski
2015-05-22 21:09 ` Linus Torvalds
2015-05-22 22:18 ` David Howells
2015-05-22 22:21 ` Linus Torvalds
2015-05-22 22:15 ` David Howells
2015-05-22 22:19 ` Andy Lutomirski
2015-05-22 22:21 ` David Howells
2015-05-22 0:03 ` Andy Lutomirski
2015-05-22 12:42 ` George Spelvin
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=1752.1432049417@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=aricart@memnix.com \
--cc=bp@alien8.de \
--cc=dwmw2@infradead.org \
--cc=jkosina@suse.cz \
--cc=keyrings@linux-nfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mmarek@suse.cz \
--cc=rusty@rustcorp.com.au \
--cc=sedat.dilek@gmail.com \
--cc=torvalds@linux-foundation.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.