Skip to content

Commit

Permalink
ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liu Hua authored and Russell King committed Apr 7, 2014
1 parent c7d442f commit 8fad87b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8fad87b

Please sign in to comment.