Re: [PATCH v4 17/19] ARM: LPAE: mark memory banks with start >ULONG_MAX as highmem

From: Russell King - ARM Linux
Date: Sat Feb 12 2011 - 05:37:10 EST


On Mon, Jan 24, 2011 at 05:55:59PM +0000, Catalin Marinas wrote:
> @@ -782,7 +782,8 @@ static void __init sanity_check_meminfo(void)
>
> #ifdef CONFIG_HIGHMEM
> if (__va(bank->start) > vmalloc_min ||
> - __va(bank->start) < (void *)PAGE_OFFSET)
> + __va(bank->start) < (void *)PAGE_OFFSET ||
> + bank->start > ULONG_MAX)

I think this check should be first, so that we don't try to evaluate __va()
on phys addresses > ULONG_MAX, possibly resulting in truncation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/