Re: [kernel-hardening] [PATCH v7 0/9] x86/mm: memory area address KASLR

From: Jason Cooper
Date: Thu Jun 23 2016 - 16:19:36 EST


On Thu, Jun 23, 2016 at 12:59:07PM -0700, Kees Cook wrote:
> On Thu, Jun 23, 2016 at 12:45 PM, Sandy Harris <sandyinchina@xxxxxxxxx> wrote:
> > Jason Cooper <jason@xxxxxxxxxxxxxx> wrote:
> >
> >> Modern systems that receive a seed from the bootloader via the
> >> random-seed property (typically from the hw-rng) can mix both sources
> >> for increased resilience.
> >>
> >> Unfortunately, I'm not very familiar with the internals of x86
> >> bootstrapping. Could GRUB be scripted to do a similar task? How would
> >> the address and size of the seed be passed to the kernel? command line?
> >
> > One suggestion is at:
> > http://www.av8n.com/computer/htm/secure-random.htm#sec-boot-image
>
> Interesting! This might pose a problem for signed images, though.
> (Actually, for signed arm kernels is the DT signed too? If so, it
> would be a similar problem.)

That's the reason for userspace,random-seed = <address, size>. Once
set, the dtb never has to change. The bootloader loads the file to the
same address at each boot. Userspace is responsible, as it is already,
for updating the random-seed file while up.

thx,

Jason.