From 5462730333264782738823fd99b44b4668efd4c4 Mon Sep 17 00:00:00 2001 From: Hosung Kim Date: Mon, 29 May 2017 15:51:50 +0900 Subject: [PATCH] [COMMON] arm64: kernel: fix show data with regs This commit fix the situation that it couldn't output register informatio which is located in vmalloc address because of kaslr enable. KASLR is the default after 4.6 kernel of arm64. Change-Id: Ied75938e89d31d1e6386ac88e5e4d9a97f1159e4 Signed-off-by: Hosung Kim --- arch/arm64/kernel/process.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 3f25b930d94a..bce35420aad0 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -188,8 +188,19 @@ static void show_data(unsigned long addr, int nbytes, const char *name) * don't attempt to dump non-kernel addresses or * values that are probably just small negative numbers */ - if (addr < PAGE_OFFSET || addr > -256UL) - return; + if (addr < PAGE_OFFSET || addr > -256UL) { + /* + * If kaslr is enabled, Kernel code is able to + * locate in VMALLOC address. + */ + if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) { + if (addr < (unsigned long)KERNEL_START || + addr > (unsigned long)KERNEL_END) + return; + } else { + return; + } + } printk("\n%s: %#lx:\n", name, addr); -- 2.20.1