Browse Source

[ARM] 5402/1: fix a case of wrap-around in sanity_check_meminfo()

In the non highmem case, if two memory banks of 1GB each are provided,
the second bank would evade suppression since its virtual base would
be 0.  Fix this by disallowing any memory bank which virtual base
address is found to be lower than PAGE_OFFSET.

Reported-by: Lennert Buytenhek <buytenh@marvell.com>

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Nicolas Pitre 16 years ago
parent
commit
3fd9825c42
1 changed files with 2 additions and 1 deletions
  1. 2 1
      arch/arm/mm/mmu.c

+ 2 - 1
arch/arm/mm/mmu.c

@@ -693,7 +693,8 @@ static void __init sanity_check_meminfo(void)
 		 * Check whether this memory bank would entirely overlap
 		 * Check whether this memory bank would entirely overlap
 		 * the vmalloc area.
 		 * the vmalloc area.
 		 */
 		 */
-		if (__va(bank->start) >= VMALLOC_MIN) {
+		if (__va(bank->start) >= VMALLOC_MIN ||
+		    __va(bank->start) < PAGE_OFFSET) {
 			printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
 			printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
 			       "(vmalloc region overlap).\n",
 			       "(vmalloc region overlap).\n",
 			       bank->start, bank->start + bank->size - 1);
 			       bank->start, bank->start + bank->size - 1);