From: Hosung Kim Date: Mon, 29 May 2017 06:51:50 +0000 (+0900) Subject: [COMMON] arm64: kernel: fix show data with regs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5462730333264782738823fd99b44b4668efd4c4;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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);