Commit e44308e6 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Will Deacon

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: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 22b6f3b0
...@@ -96,7 +96,7 @@ static void __kprobes *patch_map(void *addr, int fixmap) ...@@ -96,7 +96,7 @@ static void __kprobes *patch_map(void *addr, int fixmap)
if (module && IS_ENABLED(CONFIG_DEBUG_SET_MODULE_RONX)) if (module && IS_ENABLED(CONFIG_DEBUG_SET_MODULE_RONX))
page = vmalloc_to_page(addr); page = vmalloc_to_page(addr);
else if (!module && IS_ENABLED(CONFIG_DEBUG_RODATA)) else if (!module && IS_ENABLED(CONFIG_DEBUG_RODATA))
page = virt_to_page(addr); page = pfn_to_page(PHYS_PFN(__pa(addr)));
else else
return addr; return addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment