]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/exec: Build both static and non-static load_address tests
authorKees Cook <kees@kernel.org>
Wed, 8 May 2024 17:31:46 +0000 (10:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:12:11 +0000 (14:12 +0200)
commitd3642f29f549a0ee31ec30920bd4ef2757916b4a
tree74a3c0f6c5357d78877e21070e0b1601acc4695e
parent7435fa1c530d01b6f90d7a7524b1ec01e2c00dd8
selftests/exec: Build both static and non-static load_address tests

[ Upstream commit b57a2907c9d96c56494ef25f8ec821cd0b355dd6 ]

After commit 4d1cd3b2c5c1 ("tools/testing/selftests/exec: fix link
error"), the load address alignment tests tried to build statically.
This was silently ignored in some cases. However, after attempting to
further fix the build by switching to "-static-pie", the test started
failing. This appears to be due to non-PT_INTERP ET_DYN execs ("static
PIE") not doing alignment correctly, which remains unfixed[1]. See commit
aeb7923733d1 ("revert "fs/binfmt_elf: use PT_LOAD p_align values for
static PIE"") for more details.

Provide rules to build both static and non-static PIE binaries, improve
debug reporting, and perform several test steps instead of a single
all-or-nothing test. However, do not actually enable static-pie tests;
alignment specification is only supported for ET_DYN with PT_INTERP
("regular PIE").

Link: https://bugzilla.kernel.org/show_bug.cgi?id=215275
Link: https://lore.kernel.org/r/20240508173149.677910-1-keescook@chromium.org
Signed-off-by: Kees Cook <kees@kernel.org>
Stable-dep-of: 11854fe263eb ("binfmt_elf: Move brk for static PIE even if ASLR disabled")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/exec/Makefile
tools/testing/selftests/exec/load_address.c