Re: [PATCH] kexec: fix out of the ELF headers buffer issue in syscall kexec_file_load()

From: Baoquan He
Date: Mon Sep 28 2015 - 05:52:25 EST

On 09/28/15 at 05:39pm, joeyli wrote:
> On Mon, Sep 28, 2015 at 04:07:57PM +0800, Baoquan He wrote:
> > On 09/28/15 at 02:41pm, Lee, Chun-Yi wrote:
> > > This issue was hided on small machine that doesn't have too many CPU because
> > > the free space of ELF headers buffer can cover the number of small memory
> > > regions. But, when the machine has more CPUs or the number of memory regions
> > > very nearly to consume whole page aligned buffer, e.g. 4096, 8192... Then
> > > issue will happen randomly.
> >
> > CC akpm too.
> >
> > Read code again and I think it makes sense to use walk_system_ram_res.
> > And in prepare_elf64_headers it also uses walk_system_ram_res. That's
> > why you can find this bug. Otherwise we never find this and those small
> > regions which only spread in one page will be lost in vmcore.
> >
> > Besides could you please rearrange your patch log? It's not easy to get
> > what this patch have done.
> >
> To avoid confusing, I will simplify the patch description.
> Removing things about CPU number but keep the difference between
> walk_system_ram_res and walk_system_ram_range.

Yeah, that is good. You can simply mention why it's not found before but
happened now because of many CPUs. The root cause that small regions
residing inside one page are ignored by walk_system_ram_range() need be

Thanks for your effort!


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at