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
commit 8fad87b upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
  • Loading branch information
Liu Hua authored and Ben Hutchings committed Jul 11, 2014
1 parent fac90e8 commit 64bf838
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
@@ -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;

0 comments on commit 64bf838

Please sign in to comment.