linux/arch/arm/boot/compressed
Kees Cook 431a380f93 kstack_erase: Disable kstack_erase for all of arm compressed boot code
When building with CONFIG_KSTACK_ERASE=y and CONFIG_ARM_ATAG_DTB_COMPAT=y,
the compressed boot environment encounters an undefined symbol error:

    ld.lld: error: undefined symbol: __sanitizer_cov_stack_depth
    >>> referenced by atags_to_fdt.c:135

This occurs because the compiler instruments the atags_to_fdt() function
with sanitizer coverage calls, but the minimal compressed boot environment
lacks access to sanitizer runtime support.

The compressed boot environment already disables stack protector with
-fno-stack-protector. Similarly disable sanitizer coverage by adding
$(DISABLE_KSTACK_ERASE) to the general compiler flags (and remove it
from the one place it was noticed before), which contains the appropriate
flags to prevent sanitizer instrumentation.

This follows the same pattern used in other early boot contexts where
sanitizer runtime support is unavailable.

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYtBk8qnpWvoaFwymCx5s5i-5KXtPGpmf=_+UKJddCOnLA@mail.gmail.com
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/all/20250726004313.GA3650901@ax162
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <kees@kernel.org>
2025-07-26 14:27:33 -07:00
..
.gitignore ARM: 9154/1: decompressor: do not copy source files while building 2021-12-17 11:34:30 +00:00
ashldi3.S ARM: 9154/1: decompressor: do not copy source files while building 2021-12-17 11:34:30 +00:00
atags_to_fdt.c ARM: 9311/1: decompressor: move function prototypes to misc.h 2023-06-19 09:35:57 +01:00
big-endian.S
bswapsdi2.S ARM: 9154/1: decompressor: do not copy source files while building 2021-12-17 11:34:30 +00:00
debug.S
decompress.c ARM: dyndbg: allow including dyndbg.h in decompressor 2023-03-10 10:28:29 -08:00
efi-header.S include: pe.h: Fix PE definitions 2025-05-21 16:46:37 +02:00
fdt.c
fdt_check_mem_start.c ARM: 9311/1: decompressor: move function prototypes to misc.h 2023-06-19 09:35:57 +01:00
fdt_ro.c
fdt_rw.c
fdt_wip.c
font.c ARM: 9154/1: decompressor: do not copy source files while building 2021-12-17 11:34:30 +00:00
head-sa1100.S ARM: sa1100: remove unused board files 2023-01-12 10:53:12 +01:00
head-sharpsl.S
head-xscale.S
head.S ARM: remove check for CONFIG_DEBUG_LL_SER3 2022-09-28 22:39:21 +02:00
hyp-stub.S ARM: 9154/1: decompressor: do not copy source files while building 2021-12-17 11:34:30 +00:00
lib1funcs.S ARM: 9154/1: decompressor: do not copy source files while building 2021-12-17 11:34:30 +00:00
ll_char_wr.S
Makefile kstack_erase: Disable kstack_erase for all of arm compressed boot code 2025-07-26 14:27:33 -07:00
misc-ep93xx.h ARM: ep93xx: remove old board files 2023-01-10 23:10:27 +01:00
misc.c fortify: Improve buffer overflow reporting 2024-02-29 13:38:02 -08:00
misc.h fortify: Improve buffer overflow reporting 2024-02-29 13:38:02 -08:00
piggy.S
string.c lib/string: Move helper functions out of string.c 2021-09-25 08:20:49 -07:00
vmlinux.lds.S ARM: 9404/1: arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION 2024-06-10 12:01:33 +01:00