diff options
| author | Ard Biesheuvel <ardb@kernel.org> | 2026-05-29 17:02:00 +0200 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-06-02 16:29:15 +0100 |
| commit | 382a03e12ebad387fad616da78b99720ea3ee683 (patch) | |
| tree | 7d2e0c4dbcce194616b8761157bfb7451a388eae /arch/arm64/kernel | |
| parent | 28becb2c1d741259b2f12737e0a3828fe59700d9 (diff) | |
| download | linux-382a03e12ebad387fad616da78b99720ea3ee683.tar.gz linux-382a03e12ebad387fad616da78b99720ea3ee683.zip | |
arm64: Move fixmap and kasan page tables to end of kernel image
Move the fixmap and kasan page tables out of the BSS section, and place
them at the end of the image, right before the init_pg_dir section where
some of the other statically allocated page tables live.
These page tables are currently the only data objects in vmlinux that
are meant to be accessed via the kernel image's linear alias, and so
placing them together allows the remainder of the data/bss section to be
remapped read-only or unmapped entirely.
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/kernel')
| -rw-r--r-- | arch/arm64/kernel/vmlinux.lds.S | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index e1ac876200a3..2b0ebfb30c63 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -349,9 +349,15 @@ SECTIONS _edata = .; /* start of zero-init region */ - BSS_SECTION(SBSS_ALIGN, 0, 0) + BSS_SECTION(SBSS_ALIGN, 0, PAGE_SIZE) __pi___bss_start = __bss_start; + /* fixmap BSS starts here - preceding data/BSS is omitted from the linear map */ + .pgdir.bss (NOLOAD) : ALIGN(PAGE_SIZE) { + *(.pgdir.bss) + } + ASSERT(ADDR(.pgdir.bss) == __bss_stop, ".pgdir.bss must follow BSS") + . = ALIGN(PAGE_SIZE); __pi_init_pg_dir = .; . += INIT_DIR_SIZE; |
