Skip to contentSkip to conversation

fs-binfmt_elf-use-pt_load-p_align-values-for-static-pie.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jan 20, 2022

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: fs/binfmt_elf: use PT_LOAD p_align values for static PIE
has been removed from the -mm tree. Its filename was
fs-binfmt_elf-use-pt_load-p_align-values-for-static-pie.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: "H.J. Lu" <[email protected]>
Subject: fs/binfmt_elf: use PT_LOAD p_align values for static PIE

Extend

commit ce81bb256a224259ab686742a6284930cbe4f1fa

Author: Chris Kennelly <[email protected]>
Date:   Thu Oct 15 20:12:32 2020 -0700

fs/binfmt_elf: use PT_LOAD p_align values for suitable start address

which fixed PIE binaries built with -Wl,-z,max-page-size=0x200000, to cover static PIE binaries. This fixes:

https://bugzilla.kernel.org/show_bug.cgi?id=215275

Tested by verifying static PIE binaries with -Wl,-z,max-page-size=0x200000 loading.

Cc Chris Kennelly <[email protected]>
Cc Al Viro <[email protected]>
Cc Alexey Dobriyan <[email protected]>
Cc Song Liu <[email protected]>
Cc David Rientjes <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Sandeep Patil <[email protected]>
Cc Fangrui Song <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Mike Kravetz <[email protected]>
Cc Shuah Khan <[email protected]>

---

 fs/binfmt_elf.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/binfmt_elf.c renamed from fs/binfmt_elf.c~fs-binfmt_elf-use-pt_load-p_align-values-for-static-pie +2 -2
@@ -1116,11 +1116,11 @@ out_free_interp:
 			 * independently randomized mmap region (0 load_bias
 			 * without MAP_FIXED nor MAP_FIXED_NOREPLACE).
 			 */
-			if (interpreter) {
+			alignment = maximum_alignment(elf_phdata, elf_ex->e_phnum);
+			if (alignment > ELF_MIN_ALIGN) {
 				load_bias = ELF_ET_DYN_BASE;
 				if (current->flags & PF_RANDOMIZE)
 					load_bias += arch_mmap_rnd();
-				alignment = maximum_alignment(elf_phdata, elf_ex->e_phnum);
 				if (alignment)
 					load_bias &= ~(alignment - 1);
 				elf_flags |= MAP_FIXED_NOREPLACE;

_

Patches currently in -mm which might be from [email protected] are