[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170419000700.GF14395@x1>
Date: Wed, 19 Apr 2017 08:07:00 +0800
From: Baoquan He <bhe@...hat.com>
To: Kees Cook <keescook@...omium.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Dave Jiang <dave.jiang@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, Dave Young <dyoung@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
"x86@...nel.org" <x86@...nel.org>, Yinghai Lu <yinghai@...nel.org>,
Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH 2/4] KASLR: Parse all memmap entries in cmdline
On 04/18/17 at 04:32pm, Kees Cook wrote:
> On Tue, Apr 18, 2017 at 3:52 PM, Baoquan He <bhe@...hat.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.
Yes, didn't notice this. Will use it to do dynamic malloc.
Thanks for telling!
Powered by blists - more mailing lists