mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "George Spelvin" <linux@horizon.com>
To: linux@horizon.com, torvalds@linux-foundation.org
Cc: dhowells@redhat.com, dwmw2@infradead.org,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, luto@amacapital.net,
	petkan@mip-labs.com, tytso@mit.edu, zohar@linux.vnet.ibm.com
Subject: Re: Should we automatically generate a module signing key at all?
Date: 22 May 2015 10:13:58 -0400	[thread overview]
Message-ID: <20150522141358.2581.qmail@ns.horizon.com> (raw)
In-Reply-To: <CA+55aFxLRaZpBPUwPabmNoYGwTraM0aLv06rNPhstyT3k+hBig@mail.gmail.com>

Linus Torvalds wrote:
> It's also very annoying because the whole build gets much nastier,
> particularly if you want to have modules in external trees.
> 
> In short, I don't see any actual *advantages* over just using signed
> modules. Signing is much more flexible, and thanks to that extra
> indirection (the signing key), there are no ordering constraints on
> generating modules vs the kernel.

That's why I originally wrote:
>> To address other use cases, it's possible to allow multiple authentication
>> systems.  You can generate one big tree for in-tree modules, then either
>> additional trees or the existing public-key signatures for additions.

Reproducible builds are an attractive security feature; they enable
things like distributed double compilation.  But as you point out,
his proposed mechanism is annoyingly less flexible.

It would have to be an optional alternative to the existing public key,
not a replacement.


It seems that there are two basic ways to satisfy the distributions:

1) Create a tool to canonicalize the kernel and modules,
   stripping out the signatures before comparing them.  This has
   precedent in the way the prelink tool can un-prelink binaries
   so that hashes can be verified.

2) Provide something like Andy's hash tree that covers the in-tree case,
   in addition to the existing public-key signatures.  A reproducible
   build would just not use the public key, but it would still be available.

   One note: if the module hash database were kept separately from the
   modules, then it would only need to store the 2n-1 distinct hashes,
   not n log n.  Or, if you don't mind doing a bit more hashing, you
   could just store the n module hashes and linearly hash that list.
   That's reasonable as long as the master list of modules (32 bytes
   per module) is no larger than the modules being verified.

In both cases, the additional code is part of the attack surface.
The issue is which is less effort, less bugs, and more secure?

While option 1 avoids complcating the kernel by throwing the entire
problem over the fence to the distributions, Andy has a point that adding
option 2 to the kernel might be a lot simpler overall.


I'm also trying to think if the same issues might arise for other
code that loads modules, but the signatures are only an issue when
the "main" binary is loaded from a more trustworthy source than the
modules, a situation that is rare outside the kernel.

  parent reply	other threads:[~2015-05-22 14:14 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2015-05-18 16:04 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 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
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:37       ` Mimi Zohar
2015-05-19 15:53         ` Petko Manolov
2015-05-19 17:17         ` Andy Lutomirski
2015-05-19 15:30     ` David Howells
2015-05-19 15:55       ` Theodore Ts'o
2015-05-19 16:09         ` Petko Manolov
2015-05-19 17:32         ` Mimi Zohar
2015-05-19 17:43           ` Andy Lutomirski
2015-05-19 17:53             ` Linus Torvalds
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: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

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=20150522141358.2581.qmail@ns.horizon.com \
    --to=linux@horizon.com \
    --cc=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=petkan@mip-labs.com \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=zohar@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®