binfmt_elf: Calculate total_size earlier
authorKees Cook <kees@kernel.org>
Wed, 8 May 2024 17:31:47 +0000 (10:31 -0700)
committerKees Cook <kees@kernel.org>
Wed, 19 Jun 2024 19:44:57 +0000 (12:44 -0700)
commit2d4cf7b190bbfadd4986bf5c34da17c1a88adf8e
tree5dc6f287f7631d6aa5732fdfae7f8d1a4ca0c947
parentb57a2907c9d96c56494ef25f8ec821cd0b355dd6
binfmt_elf: Calculate total_size earlier

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>
fs/binfmt_elf.c