Re: [RFC][PATCH] Randomize kernel base address on boot

Ingo Molnar
2011-05-31T19:56:12Z

* Dan Rosenberg <drosenberg@vsecurity.com> wrote:

> Just for the record, I've put this patch on hold until there's some
> more consensus about whether boot-time randomization of the
> physical kernel address is the best approach. [...]

Well, if you use the suggestion i made: to skip the e820 map fiddling
altogether and just allocate half a megabyte of 'hole' at the end of
the kernel image - which would allow the kernel to be randomized
freely upwards by 0-128 pages - then the 'dynamic' versus 'static'
solution could be used at once!

The 'static' method would use the same hole, just at install time,
while the 'dynamic' method would use it during bootup.

Also, if this method is used then most of the controversy about the
dynamic approach goes away (which was the memory maps interpretation
fragility).

Your last patch would need only minor modifications to get the hole
added: you'd need to add the tail-hole in the linker map:

arch/x86/kernel/vmlinux.lds.S

So ... could you *please* not shelf this idea just because people
used lkml for what it was invented: argued with each other rather
forcefully? :-)

Thanks,

Ingo