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

2017-01-11 Thread Dave Jiang
On 01/11/2017 05:00 AM, Thomas Gleixner wrote: > On Tue, 10 Jan 2017, Dave Jiang wrote: >> +unsigned long simple_strtoul(const char *cp, char **endp, unsigned int >> base); >> +long simple_strtol(const char *cp, char **endp, unsigned int base); > > What are those functions for? They are not use

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

2017-01-11 Thread Thomas Gleixner
On Tue, 10 Jan 2017, Dave Jiang wrote: > +unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base); > +long simple_strtol(const char *cp, char **endp, unsigned int base); What are those functions for? They are not used in that patch at all. > +static void mem_avoid_memmap(void

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

2017-01-10 Thread Baoquan He
On 01/10/17 at 10:56am, 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

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

2017-01-10 Thread Kees Cook
On Tue, Jan 10, 2017 at 9:56 AM, 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. Tea

[PATCH v6] x86: fix kaslr and memmap collision

2017-01-10 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