]> 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:12:11 +0000 (14:12 +0200)
commitd9c175875610296890dec19f939ddf10dca67900
treebad7c29859fa36346d27fa80068d2012f47fefbe
parentd3642f29f549a0ee31ec30920bd4ef2757916b4a
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