Re: [PATCH v5] x86: fix kaslr and memmap collision

2017-01-07 Thread Baoquan He
On 01/06/17 at 01:16pm, Kees Cook wrote: > On Thu, Jan 5, 2017 at 6:44 PM, Baoquan He wrote: > >> > +static int mem_avoid_memmap(void) > >> > +{ > >> > + char arg[128]; > >> > + int rc = 0; > >> > + > >> > + /* see if we have any memmap areas */ > >> > + if (cmdline_find_option("memmap", a

Re: [PATCH v5] x86: fix kaslr and memmap collision

2017-01-06 Thread Kees Cook
On Thu, Jan 5, 2017 at 6:44 PM, Baoquan He wrote: > Add Kees to let him have a look at this too. > > On 01/05/17 at 05:21pm, Baoquan He wrote: >> On 01/04/17 at 11:29am, Dave Jiang wrote: >> > CONFIG_RANDOMIZE_BASE relocates the kernel to a random base address. >> > However it does not take into a

Re: [PATCH v5] x86: fix kaslr and memmap collision

2017-01-05 Thread Baoquan He
Add Kees to let him have a look at this too. On 01/05/17 at 05:21pm, Baoquan He wrote: > On 01/04/17 at 11:29am, Dave Jiang wrote: > > CONFIG_RANDOMIZE_BASE relocates the kernel to a random base address. > > However it does not take into account the memmap= parameter passed in from > > the kernel

Re: [PATCH v5] x86: fix kaslr and memmap collision

2017-01-05 Thread Baoquan He
On 01/04/17 at 11:29am, Dave Jiang wrote: > CONFIG_RANDOMIZE_BASE relocates the kernel to a random base address. > However it does not take into account the memmap= parameter passed in from > the kernel cmdline. This results in the kernel sometimes being put in > the middle of memmap. Teaching kasl

[PATCH v5] x86: fix kaslr and memmap collision

2017-01-04 Thread Dave Jiang
CONFIG_RANDOMIZE_BASE relocates the kernel to a random base address. However it does not take into account the memmap= parameter passed in from the kernel cmdline. This results in the kernel sometimes being put in the middle of memmap. Teaching kaslr to not insert the kernel in memmap defined regio