All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: kdump: Avoid overflow when converting pfn to physaddr
@ 2014-03-18 10:20 ` Liu Hua
  0 siblings, 0 replies; 6+ messages in thread
From: Liu Hua @ 2014-03-18 10:20 UTC (permalink / raw)
  To: linux-arm-kernel

When we configure CONFIG_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>
---
 arch/arm/kernel/crash_dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/crash_dump.c b/arch/arm/kernel/crash_dump.c
index 90c50d4..5d1286d 100644
--- a/arch/arm/kernel/crash_dump.c
+++ b/arch/arm/kernel/crash_dump.c
@@ -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;
 
-- 
1.8.5.5.dirty

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-22  5:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 10:20 [PATCH] ARM: kdump: Avoid overflow when converting pfn to physaddr Liu Hua
2014-03-18 10:20 ` Liu Hua
2014-03-18 10:48 ` Russell King - ARM Linux
2014-03-18 10:48   ` Russell King - ARM Linux
2014-03-22  5:14   ` Liu hua
2014-03-22  5:14     ` Liu hua

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.