Skip to content

Commit c96e848

Browse files
kirylKAGA-KOKO
authored andcommitted
x86/boot/compressed/64: Fix missing initialization in find_trampoline_placement()
Gustavo noticed that 'new' can be left uninitialized if 'bios_start' happens to be less or equal to 'entry->addr + entry->size'. Initialize the variable at the begin of the iteration to the current value of 'bios_start'. Fixes: 0a46fff ("x86/boot/compressed/64: Fix boot on machines with broken E820 table") Reported-by: "Gustavo A. R. Silva" <[email protected]> Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/20190826133326.7cxb4vbmiawffv2r@box
1 parent 558682b commit c96e848

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/boot/compressed/pgtable_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static unsigned long find_trampoline_placement(void)
7272

7373
/* Find the first usable memory region under bios_start. */
7474
for (i = boot_params->e820_entries - 1; i >= 0; i--) {
75-
unsigned long new;
75+
unsigned long new = bios_start;
7676

7777
entry = &boot_params->e820_table[i];
7878

0 commit comments

Comments
 (0)