[PATCH v2] arm64: map [_text, _stext) virtual address range non-executable+read-only

Will Deacon will at kernel.org
Mon Sep 22 06:14:48 PDT 2025


On Fri, 19 Sep 2025 14:27:51 -0700, Omar Sandoval wrote:
> Since the referenced fixes commit, the kernel's .text section is only
> mapped starting from _stext; the region [_text, _stext) is omitted. As a
> result, other vmalloc/vmap allocations may use the virtual addresses
> nominally in the range [_text, _stext). This address reuse confuses
> multiple things:
> 
> 1. crash_prepare_elf64_headers() sets up a segment in /proc/vmcore
>    mapping the entire range [_text, _end) to
>    [__pa_symbol(_text), __pa_symbol(_end)). Reading an address in
>    [_text, _stext) from /proc/vmcore therefore gives the incorrect
>    result.
> 2. Tools doing symbolization (either by reading /proc/kallsyms or based
>    on the vmlinux ELF file) will incorrectly identify vmalloc/vmap
>    allocations in [_text, _stext) as kernel symbols.
> 
> [...]

Applied to arm64 (for-next/mm), thanks!

[1/1] arm64: map [_text, _stext) virtual address range non-executable+read-only
      https://git.kernel.org/arm64/c/5973a62efa34

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev



More information about the linux-arm-kernel mailing list