Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713547

Re: [kernel-hardening] [PATCHv2 2/2] extract early boot entropy from the passed cmdline

From Daniel Micay <danielmicay@gmail.com>
Newsgroups linux.kernel
Subject Re: [kernel-hardening] [PATCHv2 2/2] extract early boot entropy from the passed cmdline
Date 2017-08-17 07:20 +0200
Message-ID <uflnP-es-7@gated-at.bofh.it> (permalink)
References <uffip-4yt-3@gated-at.bofh.it> <uffip-4yt-5@gated-at.bofh.it> <ufl4t-8gG-3@gated-at.bofh.it> <ufl4t-8gG-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2017-08-16 at 21:58 -0700, Kees Cook wrote:
> On Wed, Aug 16, 2017 at 9:56 PM, Nick Kralevich <nnk@google.com>
> wrote:
> > On Wed, Aug 16, 2017 at 3:46 PM, Laura Abbott <labbott@redhat.com>
> > wrote:
> > > From: Daniel Micay <danielmicay@gmail.com>
> > > 
> > > Existing Android bootloaders usually pass data useful as early
> > > entropy
> > > on the kernel command-line. It may also be the case on other
> > > embedded
> > > systems. Sample command-line from a Google Pixel running
> > > CopperheadOS:
> > > 
> > 
> > Why is it better to put this into the kernel, rather than just rely
> > on
> > the existing userspace functionality which does exactly the same
> > thing? This is what Android already does today:
> > https://android-review.googlesource.com/198113
> 
> That's too late for setting up the kernel stack canary, among other
> things. The kernel will also be generating some early secrets for slab
> cache canaries, etc. That all needs to happen well before init is
> started.
> 
> -Kees
> 

It's also unfortunately the kernel's global stack canary for the entire
boot since unlike x86 there aren't per-task canaries. GCC / Clang access
it via a segment register on x86 vs. a global on other architectures.

In theory it could be task-local elsewhere but doing it efficiently
would imply reserving a register to store the random value. I think that
may actually end up helping performance more than it hurts by not
needing to read the global stack canary value from cache repeatedly. If
stack canaries were augmented into something more (XOR in the retaddr
and offer the option of more coverage than STRONG) it would be more
important.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv2 2/2] extract early boot entropy from the passed cmdline Laura Abbott <labbott@redhat.com> - 2017-08-17 00:50 +0200
  Re: [kernel-hardening] [PATCHv2 2/2] extract early boot entropy from  the passed cmdline Kees Cook <keescook@chromium.org> - 2017-08-17 07:00 +0200
    Re: [kernel-hardening] [PATCHv2 2/2] extract early boot entropy  from the passed cmdline Daniel Micay <danielmicay@gmail.com> - 2017-08-17 07:20 +0200
  Re: [kernel-hardening] [PATCHv2 2/2] extract early boot entropy from  the passed cmdline Nick Kralevich <nnk@google.com> - 2017-08-17 07:00 +0200

csiph-web