Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Baoquan He
On 04/18/17 at 04:32pm, Kees Cook wrote: > On Tue, Apr 18, 2017 at 3:52 PM, Baoquan He wrote: > > On 04/18/17 at 01:22pm, Kees Cook wrote: > >> > +#define COMMAND_LINE_SIZE 256 > >> > +static int handle_mem_memmap(void) > >> > +{ > >> > + char *args = (char

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Baoquan He
On 04/18/17 at 04:32pm, Kees Cook wrote: > On Tue, Apr 18, 2017 at 3:52 PM, Baoquan He wrote: > > On 04/18/17 at 01:22pm, Kees Cook wrote: > >> > +#define COMMAND_LINE_SIZE 256 > >> > +static int handle_mem_memmap(void) > >> > +{ > >> > + char *args = (char *)get_cmd_line_ptr(); > >> > +

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Kees Cook
On Tue, Apr 18, 2017 at 3:52 PM, Baoquan He wrote: > On 04/18/17 at 01:22pm, Kees Cook wrote: >> > +#define COMMAND_LINE_SIZE 256 >> > +static int handle_mem_memmap(void) >> > +{ >> > + char *args = (char *)get_cmd_line_ptr(); >> > + char

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Kees Cook
On Tue, Apr 18, 2017 at 3:52 PM, Baoquan He wrote: > On 04/18/17 at 01:22pm, Kees Cook wrote: >> > +#define COMMAND_LINE_SIZE 256 >> > +static int handle_mem_memmap(void) >> > +{ >> > + char *args = (char *)get_cmd_line_ptr(); >> > + char tmp_cmdline[COMMAND_LINE_SIZE]; >> >> Can't

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Baoquan He
Hi Kees, Thanks for your reviewing! On 04/18/17 at 01:22pm, Kees Cook wrote: > > static int > > parse_memmap(char *p, unsigned long long *start, unsigned long long *size) > > @@ -142,40 +112,33 @@ parse_memmap(char *p, unsigned long long *start, > > unsigned long long *size) > >

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Baoquan He
Hi Kees, Thanks for your reviewing! On 04/18/17 at 01:22pm, Kees Cook wrote: > > static int > > parse_memmap(char *p, unsigned long long *start, unsigned long long *size) > > @@ -142,40 +112,33 @@ parse_memmap(char *p, unsigned long long *start, > > unsigned long long *size) > >

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Kees Cook
On Mon, Apr 17, 2017 at 6:34 AM, Baoquan He wrote: > In commit f28442497b5c ("x86/boot: Fix KASLR and memmap= collision"), > memmap= option is parsed so that kaslr can avoid those reserved > regions. It uses cmdline_find_option to get the value if memmap= > is specified, however

Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-18 Thread Kees Cook
On Mon, Apr 17, 2017 at 6:34 AM, Baoquan He wrote: > In commit f28442497b5c ("x86/boot: Fix KASLR and memmap= collision"), > memmap= option is parsed so that kaslr can avoid those reserved > regions. It uses cmdline_find_option to get the value if memmap= > is specified, however the problem is

[PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-17 Thread Baoquan He
In commit f28442497b5c ("x86/boot: Fix KASLR and memmap= collision"), memmap= option is parsed so that kaslr can avoid those reserved regions. It uses cmdline_find_option to get the value if memmap= is specified, however the problem is cmdline_find_option can only find the last entry if multiple

[PATCH 2/4] KASLR: Parse all memmap entries in cmdline

2017-04-17 Thread Baoquan He
In commit f28442497b5c ("x86/boot: Fix KASLR and memmap= collision"), memmap= option is parsed so that kaslr can avoid those reserved regions. It uses cmdline_find_option to get the value if memmap= is specified, however the problem is cmdline_find_option can only find the last entry if multiple