lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 30 Nov 2018 09:26:32 +0100
From:   Ard Biesheuvel <ard.biesheuvel@...aro.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     linux-efi <linux-efi@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Arend Van Spriel <arend.vanspriel@...adcom.com>,
        Bhupesh Sharma <bhsharma@...hat.com>,
        Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...el.com>,
        Eric Snowberg <eric.snowberg@...cle.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Joe Perches <joe@...ches.com>,
        Jon Hunter <jonathanh@...dia.com>,
        Julien Thierry <julien.thierry@....com>,
        Marc Zyngier <marc.zyngier@....com>,
        Nathan Chancellor <natechancellor@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        "Prakhya, Sai Praneeth" <sai.praneeth.prakhya@...el.com>,
        Sedat Dilek <sedat.dilek@...il.com>,
        YiFei Zhu <zhuyifei1999@...il.com>
Subject: Re: [PATCH 01/11] x86/efi: Allocate e820 buffer before calling efi_exit_boot_service

On Fri, 30 Nov 2018 at 08:29, Ingo Molnar <mingo@...nel.org> wrote:
>
>
> * Ard Biesheuvel <ard.biesheuvel@...aro.org> wrote:
>
> > From: Eric Snowberg <eric.snowberg@...cle.com>
> >
> > Commit d64934019f6c ("x86/efi: Use efi_exit_boot_services()")
> > introduced a regression on systems with large memory maps
> > causing them to hang on boot. The first "goto get_map" that was removed
> > from exit_boot insured there was enough room for the memory map when
> > efi_call_early(exit_boot_services) was called. This happens when
> > (nr_desc > ARRAY_SIZE(params->e820_table).
> >
> > Chain of events:
> >   exit_boot()
> >     efi_exit_boot_services()
> >       efi_get_memory_map <- at this point the mm can't grow over 8 desc
> >       priv_func()
> >         exit_boot_func()
> >           allocate_e820ext() <- new mm grows over 8 desc from e820 alloc
> >       efi_call_early(exit_boot_services) <- mm key doesn't match so retry
> >       efi_call_early(get_memory_map) <- not enough room for new mm
> >       system hangs
> >
> > This patch allocates the e820 buffer before calling efi_exit_boot_services
> > and fixes the regression.
> >
> > Signed-off-by: Eric Snowberg <eric.snowberg@...cle.com>
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
> > ---
> >  arch/x86/boot/compressed/eboot.c | 65 ++++++++++++++++++++------------
> >  1 file changed, 41 insertions(+), 24 deletions(-)
>
> Any objections against marking this for -stable and filing it in
> efi/urgent? Boot hangs are show-stopper bugs, so distributions would want
> to backport this fix anyway.
>

No objections per se, but this is the kind of patch that might go the
other way as well, so I would prefer to give it some wider coverage at
first, given how quickly patches are taken into -stable.

I can make a note of it and send it to Greg halfway into the next -rc cycle.

> > +     boot_map.map =          &map;
> > +     boot_map.map_size =     &map_size;
> > +     boot_map.desc_size =    &desc_size;
> > +     boot_map.desc_ver =     NULL;
> > +     boot_map.key_ptr =      NULL;
> > +     boot_map.buff_size =    &buff_size;
>
> I have changed this to the canonical style, which is also used elsewhere
> in the file:
>
> >       map.buff_size           = &buff_size;
> >       priv.boot_params        = boot_params;
> >       priv.efi                = &boot_params->efi_info;
> > -     priv.e820ext            = NULL;
> > -     priv.e820ext_size       = 0;
>
> I.e.:
>
> +       boot_map.map            = &map;
> +       boot_map.map_size       = &map_size;
> +       boot_map.desc_size      = &desc_size;
> +       boot_map.desc_ver       = NULL;
> +       boot_map.key_ptr        = NULL;
> +       boot_map.buff_size      = &buff_size;
> +
> +       status = efi_get_memory_map(sys_table, &boot_map);
>

Excellent, thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ