The patch titled Subject: fs/binfmt_elf: fix PT_LOAD p_align values for loaders has been added to the -mm tree. Its filename is fs-binfmt_elf-fix-pt_load-p_align-values-for-loaders.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/fs-binfmt_elf-fix-pt_load-p_align-values-for-loaders.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/fs-binfmt_elf-fix-pt_load-p_align-values-for-loaders.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Mike Rapoport <rppt@xxxxxxxxxxxxx> Subject: fs/binfmt_elf: fix PT_LOAD p_align values for loaders Rui Salvaterra reported that Aisleroit solitaire crashes with "Wrong __data_start/_end pair" assertion from libgc after update to v5.17-rc1. Bisection pointed to commit 9630f0d60fec ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE") that fixed handling of static PIEs, but made the condition that guards load_bias calculation to exclude loader binaries. Restoring the check for presence of interpreter fixes the problem. Link: https://lkml.kernel.org/r/20220202121433.3697146-1-rppt@xxxxxxxxxx Fixes: 9630f0d60fec ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE") Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxx> Reported-by: Rui Salvaterra <rsalvaterra@xxxxxxxxx> Tested-by: Rui Salvaterra <rsalvaterra@xxxxxxxxx> Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Eric Biederman <ebiederm@xxxxxxxxxxxx> Cc: "H.J. Lu" <hjl.tools@xxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/binfmt_elf.c~fs-binfmt_elf-fix-pt_load-p_align-values-for-loaders +++ a/fs/binfmt_elf.c @@ -1117,7 +1117,7 @@ out_free_interp: * without MAP_FIXED nor MAP_FIXED_NOREPLACE). */ alignment = maximum_alignment(elf_phdata, elf_ex->e_phnum); - if (alignment > ELF_MIN_ALIGN) { + if (interpreter || alignment > ELF_MIN_ALIGN) { load_bias = ELF_ET_DYN_BASE; if (current->flags & PF_RANDOMIZE) load_bias += arch_mmap_rnd(); _ Patches currently in -mm which might be from rppt@xxxxxxxxxxxxx are mm-pgtable-define-pte_index-so-that-preprocessor-could-recognize-it.patch fs-binfmt_elf-fix-pt_load-p_align-values-for-loaders.patch