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

From: Dan Rosenberg
Date: Tue May 31 2011 - 16:17:19 EST


On Tue, 2011-05-31 at 21:55 +0200, Ingo Molnar wrote:
> * Dan Rosenberg <drosenberg@xxxxxxxxxxxxx> 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? :-)
>

Don't worry, I haven't shelved the idea...I just wanted to see more of
the on-going conversation before investing a substantial amount of time
on a potentially infeasible solution. I'll give this approach a shot.

-Dan

> Thanks,
>
> Ingo


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/