lkml.org 
[lkml]   [2018]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 093/361] efi/x86: Call efi_parse_options() from efi_main()
    Date
    4.19-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Hans de Goede <hdegoede@redhat.com>

    [ Upstream commit c33ce984435bb6142792802d75513a71e55d1969 ]

    Before this commit we were only calling efi_parse_options() from
    make_boot_params(), but make_boot_params() only gets called if the
    kernel gets booted directly as an EFI executable. So when booted through
    e.g. grub we ended up not parsing the commandline in the boot code.

    This makes the drivers/firmware/efi/libstub code ignore the "quiet"
    commandline argument resulting in the following message being printed:
    "EFI stub: UEFI Secure Boot is enabled."

    Despite the quiet request. This commits adds an extra call to
    efi_parse_options() to efi_main() to make sure that the options are
    always processed. This fixes quiet not working.

    This also fixes the libstub code ignoring nokaslr and efi=nochunk.

    Reported-by: Peter Robinson <pbrobinson@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    arch/x86/boot/compressed/eboot.c | 10 ++++++++++
    1 file changed, 10 insertions(+)

    --- a/arch/x86/boot/compressed/eboot.c
    +++ b/arch/x86/boot/compressed/eboot.c
    @@ -738,6 +738,7 @@ efi_main(struct efi_config *c, struct bo
    struct desc_struct *desc;
    void *handle;
    efi_system_table_t *_table;
    + unsigned long cmdline_paddr;

    efi_early = c;

    @@ -756,6 +757,15 @@ efi_main(struct efi_config *c, struct bo
    setup_boot_services32(efi_early);

    /*
    + * make_boot_params() may have been called before efi_main(), in which
    + * case this is the second time we parse the cmdline. This is ok,
    + * parsing the cmdline multiple times does not have side-effects.
    + */
    + cmdline_paddr = ((u64)hdr->cmd_line_ptr |
    + ((u64)boot_params->ext_cmd_line_ptr << 32));
    + efi_parse_options((char *)cmdline_paddr);
    +
    + /*
    * If the boot loader gave us a value for secure_boot then we use that,
    * otherwise we ask the BIOS.
    */

    \
     
     \ /
      Last update: 2018-11-11 23:28    [W:4.133 / U:0.992 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site