Skip to content

Commit

Permalink
x86: fix 64k corruption-check
Browse files Browse the repository at this point in the history
Impact: fix boot crash

Need to exit early if the addr is far above 64k.

The crash got exposed by:

  78a8b35: x86: make e820_update_range() handle small range update

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: <stable@kernel.org>
LKML-Reference: <49BC2279.2030101@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Mar 15, 2009
1 parent 78a8b35 commit 6d7942d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kernel/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ void __init setup_bios_corruption_check(void)
if (!(addr + 1))
break;

if (addr >= corruption_check_size)
break;

if ((addr + size) > corruption_check_size)
size = corruption_check_size - addr;

if (size == 0)
break;

e820_update_range(addr, size, E820_RAM, E820_RESERVED);
scan_areas[num_scan_areas].addr = addr;
scan_areas[num_scan_areas].size = size;
Expand Down

0 comments on commit 6d7942d

Please sign in to comment.