]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
binfmt_elf: Calculate total_size earlier
authorKees Cook <kees@kernel.org>
Wed, 8 May 2024 17:31:47 +0000 (10:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 May 2025 12:09:59 +0000 (14:09 +0200)
commit2fb38e1a0164cd41dfed57da36e95ecbb0f39391
treeab272d82811eb2135fa873fead17e7203163f0da
parentadd3a49ae91a1f6390b3fbf14a7ec9c6231bfbd6
binfmt_elf: Calculate total_size earlier

[ Upstream commit 2d4cf7b190bbfadd4986bf5c34da17c1a88adf8e ]

In preparation to support PT_LOAD with large p_align values on
non-PT_INTERP ET_DYN executables (i.e. "static pie"), we'll need to use
the total_size details earlier. Move this separately now to make the
next patch more readable. As total_size and load_bias are currently
calculated separately, this has no behavioral impact.

Link: https://lore.kernel.org/r/20240508173149.677910-2-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>
fs/binfmt_elf.c