ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
authorLiu Hua <sdu.liu@huawei.com>
Thu, 27 Mar 2014 05:56:18 +0000 (06:56 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Apr 2014 11:10:00 +0000 (12:10 +0100)
When we configure CONFIG_ARM_LPAE=y, pfn << PAGE_SHIFT will
overflow if pfn >= 0x100000 in copy_oldmem_page.
So use __pfn_to_phys for converting.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/crash_dump.c

index 90c50d4..5d1286d 100644 (file)
@@ -39,7 +39,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
        if (!csize)
                return 0;
 
-       vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
+       vaddr = ioremap(__pfn_to_phys(pfn), PAGE_SIZE);
        if (!vaddr)
                return -ENOMEM;