arm64/boot: Disallow BSS exports to startup code

BSS might be uninitialized when entering the startup code, so forbid the
use by the startup code of any variables that live after __bss_start in
the linker map.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
Link: https://lore.kernel.org/r/20250508114328.2460610-8-ardb+git@google.com
[will: Drop export of 'memstart_offset_seed', as this has been removed]
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Ard Biesheuvel
2025-05-08 13:43:32 +02:00
committed by Will Deacon
parent 4afff6cc9a
commit 9053052107
2 changed files with 32 additions and 26 deletions

View File

@@ -319,6 +319,7 @@ SECTIONS
/* start of zero-init region */
BSS_SECTION(SBSS_ALIGN, 0, 0)
__pi___bss_start = __bss_start;
. = ALIGN(PAGE_SIZE);
__pi_init_pg_dir = .;
@@ -332,6 +333,7 @@ SECTIONS
. = ALIGN(SEGMENT_ALIGN);
__pecoff_data_size = ABSOLUTE(. - __initdata_begin);
_end = .;
__pi__end = .;
STABS_DEBUG
DWARF_DEBUG