]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
x86: fix 64k corruption-check
authorYinghai Lu <yinghai@kernel.org>
Sat, 14 Mar 2009 21:32:41 +0000 (14:32 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 15 Mar 2009 06:03:15 +0000 (07:03 +0100)
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>
arch/x86/kernel/check.c

index b617b1164f1e08908b86d30284ceec0ff1b491f0..fc999e6fc46a34cf1417cd600c11a0e07af1acfd 100644 (file)
@@ -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;