1
0
Fork 0
alistair23-linux/arch/x86/boot/compressed
Kirill A. Shutemov 0a46fff2f9 x86/boot/compressed/64: Fix boot on machines with broken E820 table
BIOS on Samsung 500C Chromebook reports very rudimentary E820 table that
consists of 2 entries:

  BIOS-e820: [mem 0x0000000000000000-0x0000000000000fff] usable
  BIOS-e820: [mem 0x00000000fffff000-0x00000000ffffffff] reserved

It breaks logic in find_trampoline_placement(): bios_start lands on the
end of the first 4k page and trampoline start gets placed below 0.

Detect underflow and don't touch bios_start for such cases. It makes
kernel ignore E820 table on machines that doesn't have two usable pages
below BIOS_START_MAX.

Fixes: 1b3a626436 ("x86/boot/compressed/64: Validate trampoline placement against E820")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=203463
Link: https://lkml.kernel.org/r/20190813131654.24378-1-kirill.shutemov@linux.intel.com
2019-08-19 15:59:13 +02:00
..
.gitignore x86, boot: add new generated files to the appropriate .gitignore files 2009-06-02 21:13:30 -07:00
Makefile x86/boot: Early parse RSDP and save it in boot_params 2019-02-01 11:52:55 +01:00
acpi.c x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernels 2019-06-06 20:28:37 +02:00
cmdline.c x86/boot: Build the command line parsing code unconditionally 2019-02-01 11:51:01 +01:00
cpuflags.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
early_serial_console.c x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTK 2014-08-17 14:58:24 -07:00
eboot.c x86/boot/efi: Remove unused variables 2019-07-18 21:41:57 +02:00
eboot.h efi/x86: Align efi_uga_draw_protocol typedef names to convention 2018-07-22 14:13:42 +02:00
efi_stub_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
efi_stub_64.S x86/efi: Avoid triple faults during EFI mixed mode calls 2015-02-13 15:42:56 +00:00
efi_thunk_64.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
error.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
error.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
head_32.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
head_64.S x86/boot: Make the GDT 8-byte aligned 2019-06-27 10:56:11 +02:00
kaslr.c x86/boot/KASLR: Always return a value from process_mem_region 2019-03-06 22:55:30 +01:00
kaslr_64.c x86/mm: Decouple dynamic __PHYSICAL_MASK from AMD SME 2018-06-06 13:38:01 +02:00
mem_encrypt.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
misc.c x86, boot: Remove multiple copy of static function sanitize_boot_params() 2019-07-18 21:41:57 +02:00
misc.h x86, boot: Remove multiple copy of static function sanitize_boot_params() 2019-07-18 21:41:57 +02:00
mkpiggy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 268 2019-06-05 17:30:29 +02:00
pgtable.h x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline before returning to long mode 2019-01-29 21:58:59 +01:00
pgtable_64.c x86/boot/compressed/64: Fix boot on machines with broken E820 table 2019-08-19 15:59:13 +02:00
string.c x86/boot: Provide KASAN compatible aliases for string routines 2019-05-24 08:44:16 +02:00
vmlinux.lds.S x86/build: Use the single-argument OUTPUT_FORMAT() linker script command 2019-01-16 12:21:53 +01:00