]> git.hungrycats.org Git - linux/commitdiff
x86: fix 64k corruption-check
authorYinghai Lu <yinghai@kernel.org>
Mon, 30 Mar 2009 18:50:28 +0000 (18:50 +0000)
committerChris Wright <chrisw@sous-sol.org>
Thu, 2 Apr 2009 20:55:19 +0000 (13:55 -0700)
upstream commit: 6d7942dc2a70a7e74c352107b150265602671588

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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/x86/kernel/check.c

index 2ac0ab71412a59f9c9e0b025d88f0acf9e7e39ff..a7a50b24eb9e1f964ff36247811a21a4ece3314d 100644 (file)
@@ -86,12 +86,12 @@ void __init setup_bios_corruption_check(void)
                if (addr == 0)
                        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;