History

efi/x86: Fix boot regression on systems with invalid memmap entries

In efi_clean_memmap(), we do a pass over the EFI memory map to remove bogus entries that may be returned on certain systems. This recent commit: 1db91035d01aa8bf ("efi: Add tracking for dynamically allocated memmaps") refactored this code to pass the input to efi_memmap_install() via a temporary struct on the stack, which is populated using an initializer which inadvertently defines the value of its size field in terms of its desc_size field, which value cannot be relied upon yet in the initializer itself. Fix this by using efi.memmap.desc_size instead, which is where we get the value for desc_size from in the first place.

Ard Biesheuvel committed 6 years ago

Commit 59365ca1 parent b3a60821 file · +1 −1Browse files

Unified · Split

arch/x86/platform/efi/efi.c+1−1
@@ -308,7 +308,7 @@ static void __init efi_clean_memmap(void) · 307 unmodified lines
308308 .phys_map = efi.memmap.phys_map,
309309 .desc_version = efi.memmap.desc_version,
310310 .desc_size = efi.memmap.desc_size,
311− .size = data.desc_size * (efi.memmap.nr_map - n_removal),
311+ .size = efi.memmap.desc_size * (efi.memmap.nr_map - n_removal),
312312 .flags = 0,
313313 };
314314

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t