Re: [PATCH v3] x86, kaslr: Prevent .bss from overlaping initrd

2014-11-19 Thread H. Peter Anvin
On 11/17/2014 06:23 PM, Greg Thelen wrote: > > On Mon, Nov 17 2014, Greg Thelen wrote: > [...] >> Given that bss and brk are nobits (i.e. only ALLOC) sections, does >> file_offset make sense as a load address. This fails with gold: >> It really doesn't. We have that information elsewhere.

Re: [PATCH v3] x86, kaslr: Prevent .bss from overlaping initrd

2014-11-17 Thread Greg Thelen
On Mon, Nov 17 2014, Greg Thelen wrote: [...] > Given that bss and brk are nobits (i.e. only ALLOC) sections, does > file_offset make sense as a load address. This fails with gold: > > $ git checkout v3.18-rc5 > $ make # with gold > [...] > ..bss and .brk lack common file offset > ..bss and .brk

Re: [PATCH v3] x86, kaslr: Prevent .bss from overlaping initrd

2014-11-17 Thread Greg Thelen
On Fri, Oct 31 2014, Junjie Mao wrote: > When choosing a random address, the current implementation does not take into > account the reversed space for .bss and .brk sections. Thus the relocated > kernel > may overlap other components in memory. Here is an example of the overlap > from a > x86_6

Re: [PATCH v3] x86, kaslr: Prevent .bss from overlaping initrd

2014-10-31 Thread Kees Cook
On Fri, Oct 31, 2014 at 6:40 AM, Junjie Mao wrote: > When choosing a random address, the current implementation does not take into > account the reversed space for .bss and .brk sections. Thus the relocated > kernel > may overlap other components in memory. Here is an example of the overlap > fr

[PATCH v3] x86, kaslr: Prevent .bss from overlaping initrd

2014-10-31 Thread Junjie Mao
When choosing a random address, the current implementation does not take into account the reversed space for .bss and .brk sections. Thus the relocated kernel may overlap other components in memory. Here is an example of the overlap from a x86_64 kernel in qemu (the ranges of physical addresses are