lkml.org 
[lkml]   [2017]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline
On Tue, Apr 18, 2017 at 3:52 PM, Baoquan He <bhe@redhat.com> 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 this use a dynamic allocation instead of the 256 limit?
>
> This is in boot/compressed code, no mm allocator built yet? Am I right?

misc.c uses malloc for phdrs, and the boot_heap is create to build an
area for those calls, see include/linux/decompress/mm.h. I *think* it
should be safe to use malloc here. It should be a pretty small
allocation normally.

-Kees

--
Kees Cook
Pixel Security

\
 
 \ /
  Last update: 2017-04-19 01:34    [W:0.064 / U:25.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site