Re: [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12.06.2017 at 17:24 wrote Greg Kroah-Hartman:
> 4.11-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Dave Young <dyoung@xxxxxxxxxx>
> 
> commit 7425826f4f7ac60f2538b06a7f0a5d1006405159 upstream.
> 
> Sabrina Dubroca reported an early panic:
> 
>   BUG: unable to handle kernel paging request at ffffffffff240001
>   IP: efi_bgrt_init+0xdc/0x134
> 
>   [...]
> 
>   ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> 
> ... which was introduced by:
> 
>   7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
> 
> The cause is that on this machine the firmware provides the EFI ACPI BGRT
> table even on legacy non-EFI bootups - which table should be EFI only.
> 
> The garbage BGRT data causes the efi_bgrt_init() panic.
> 
> Add a check to skip efi_bgrt_init() in case non-EFI bootup to work around
> this firmware bug.
> 
> Tested-by: Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>
> Signed-off-by: Dave Young <dyoung@xxxxxxxxxx>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
> Signed-off-by: Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: linux-efi@xxxxxxxxxxxxxxx
> Fixes: 7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
> Link: http://lkml.kernel.org/r/20170526113652.21339-6-matt@xxxxxxxxxxxxxxxxxxx
> [ Rewrote the changelog to be more readable. ]
> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> 
> ---
>  arch/x86/platform/efi/efi-bgrt.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- a/arch/x86/platform/efi/efi-bgrt.c
> +++ b/arch/x86/platform/efi/efi-bgrt.c
> @@ -36,6 +36,9 @@ void __init efi_bgrt_init(struct acpi_ta
>  	if (acpi_disabled)
>  		return;
>  
> +	if (!efi_enabled(EFI_BOOT))
> +		return;
> +
>  	if (table->length < sizeof(bgrt_tab)) {
>  		pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",
>  		       table->length, sizeof(bgrt_tab));
> 
> 
> 

The patch is ok but it only fixes BIOS systems.
To fix the regression above (commit 7b0a911478c7) for EFI systems 
it needs this patch as well:
commit 792ef14df5c585c19b2831673a077504a09e5203 master
(efi: Fix boot panic because of invalid BGRT image address)
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux