From: Ard Biesheuvel Date: Wed, 30 Mar 2016 14:45:59 +0000 (+0200) Subject: arm64: insn: avoid virt_to_page() translations on core kernel symbols X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e44308e62e19b42810207780a2a32148af0cb5d9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git arm64: insn: avoid virt_to_page() translations on core kernel symbols Before restricting virt_to_page() to the linear mapping, ensure that the text patching code does not use it to resolve references into the core kernel text, which is mapped in the vmalloc area. Signed-off-by: Ard Biesheuvel Signed-off-by: Will Deacon --- diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index 7371455160e5..368c08290dd8 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -96,7 +96,7 @@ static void __kprobes *patch_map(void *addr, int fixmap) if (module && IS_ENABLED(CONFIG_DEBUG_SET_MODULE_RONX)) page = vmalloc_to_page(addr); else if (!module && IS_ENABLED(CONFIG_DEBUG_RODATA)) - page = virt_to_page(addr); + page = pfn_to_page(PHYS_PFN(__pa(addr))); else return addr;