diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-04-01 15:10:25 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-04-01 15:10:25 +0200 |
commit | 84a87c628a12f95d8b0c86cc7b8edb28ea5edf90 (patch) | |
tree | 320a9ecbea3e7899dd933e333d0fb64a7d5b3b11 /drivers/firmware/efi/libstub/fdt.c | |
parent | e42391cd048809d903291d07f86ed3934ce138e9 (diff) | |
parent | a643375f4b175569bc3c03c7a3e758f845c1ccd9 (diff) | |
download | linux-84a87c628a12f95d8b0c86cc7b8edb28ea5edf90.tar.gz linux-84a87c628a12f95d8b0c86cc7b8edb28ea5edf90.tar.bz2 linux-84a87c628a12f95d8b0c86cc7b8edb28ea5edf90.zip |
Merge tag 'efi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi into core/efi
Pull EFI updates from Matt Fleming:
- Fixes and cleanups for SMBIOS 3.0 DMI code. (Ivan Khoronzhuk)
- A new efi=debug command line option that enables debug output in the
EFI boot stub and results in less verbose EFI memory map output by
default. (Borislav Petkov)
- Disable interrupts around EFI calls and use a more standard page
table saving and restoring idiom when making EFI calls. (Ingo Molnar)
- Reduce the number of memory allocations performed when allocating the
FDT in EFI boot stub by retrieving size from the FDT header in the
EFI config table. (Ard Biesheuvel)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/fdt.c')
-rw-r--r-- | drivers/firmware/efi/libstub/fdt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c index 91da56c4fd54..ef5d764e2a27 100644 --- a/drivers/firmware/efi/libstub/fdt.c +++ b/drivers/firmware/efi/libstub/fdt.c @@ -323,7 +323,7 @@ fail: return EFI_LOAD_ERROR; } -void *get_fdt(efi_system_table_t *sys_table) +void *get_fdt(efi_system_table_t *sys_table, unsigned long *fdt_size) { efi_guid_t fdt_guid = DEVICE_TREE_GUID; efi_config_table_t *tables; @@ -336,6 +336,11 @@ void *get_fdt(efi_system_table_t *sys_table) for (i = 0; i < sys_table->nr_tables; i++) if (efi_guidcmp(tables[i].guid, fdt_guid) == 0) { fdt = (void *) tables[i].table; + if (fdt_check_header(fdt) != 0) { + pr_efi_err(sys_table, "Invalid header detected on UEFI supplied FDT, ignoring ...\n"); + return NULL; + } + *fdt_size = fdt_totalsize(fdt); break; } |