• Omar Sandoval's avatar
    x86/efi: Don't try to reserve runtime regions · 41d8b02f
    Omar Sandoval authored
    commit 6f6266a5 upstream.
    
    Reserving a runtime region results in splitting the EFI memory
    descriptors for the runtime region. This results in runtime region
    descriptors with bogus memory mappings, leading to interesting crashes
    like the following during a kexec:
    
      general protection fault: 0000 [#1] SMP
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc1 #53
      Hardware name: Wiwynn Leopard-Orv2/Leopard-DDR BW, BIOS LBM05   09/30/2016
      RIP: 0010:virt_efi_set_variable()
      ...
      Call Trace:
       efi_delete_dummy_variable()
       efi_enter_virtual_mode()
       start_kernel()
       ? set_init_arg()
       x86_64_start_reservations()
       x86_64_start_kernel()
       start_cpu()
      ...
      Kernel panic - not syncing: Fatal exception
    
    Runtime regions will not be freed and do not need to be reserved, so
    skip the memmap modification in this case.
    Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
    Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
    Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Cc: Dave Young <dyoung@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Jones <pjones@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-efi@vger.kernel.org
    Fixes: 8e80632f ("efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()")
    Link: http://lkml.kernel.org/r/20170412152719.9779-2-matt@codeblueprint.co.ukSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    41d8b02f
quirks.c 13.4 KB