Skip to content

Commit

Permalink
x86/boot/compressed/64: Fix missing initialization in find_trampoline…
Browse files Browse the repository at this point in the history
…_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
  • Loading branch information
kiryl authored and KAGA-KOKO committed Aug 27, 2019
1 parent 558682b commit c96e848
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/boot/compressed/pgtable_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static unsigned long find_trampoline_placement(void)

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

entry = &boot_params->e820_table[i];

Expand Down

0 comments on commit c96e848

Please sign in to comment.