Skip to content

binfmt_elf: Support segments with 0 filesz and misaligned starts

Kees Cook linux-arch linux-fsdevel linux-hardening linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest6 patches 11 repliesIn review
  2. v34 patches 4 repliesSuperseded

Changes in v4 from the cover letter

- refactor load_elf_library() too
- don't refactor padzero(), just test in the only remaining caller
- drop now-unused vm_brk()
v3: https://lore.kernel.org/all/[email protected]
v2: https://lore.kernel.org/lkml/[email protected]
v1: https://lore.kernel.org/lkml/[email protected]

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6binfmt_elf: Support segments with 0 filesz and misaligned startsfs/binfmt_elf.c+48 -632 replies
2/6binfmt_elf: elf_bss no longer used by load_elf_binary()fs/binfmt_elf.c+1 -50 replies
3/6binfmt_elf: Use elf_load() for interpreterfs/binfmt_elf.c+1 -450 replies
4/6binfmt_elf: Use elf_load() for libraryfs/binfmt_elf.c+4 -193 replies
5/6binfmt_elf: Only report padzero() errors when PROT_WRITEfs/binfmt_elf.c+23 -90 replies
6/6mm: Remove unused vm_brk()include/linux/mm.h mm/mmap.c mm/nommu.c+1 -130 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPedro FalcatoKees Cook
SeriesT-b R-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/6] binfmt_elf: Support segments with 0 filesz and misaligned starts

Hi,

This is the continuation of the work Eric started for handling "p_memsz > p_filesz" in arbitrary segments (rather than just the last, BSS, segment). I've added the suggested changes:

- drop unused "elf_bss" variable
- refactor load_elf_interp() to use elf_load()
- refactor load_elf_library() to use elf_load()
- report padzero() errors when PROT_WRITE is present
- drop vm_brk()

Thanks!

-Kees

v4:
- refactor load_elf_library() too
- don't refactor padzero(), just test in the only remaining caller
- drop now-unused vm_brk()
v3: https://lore.kernel.org/all/[email protected]
v2: https://lore.kernel.org/lkml/[email protected]
v1: https://lore.kernel.org/lkml/[email protected]

Eric W. Biederman (1):
binfmt_elf: Support segments with 0 filesz and misaligned starts

Kees Cook (5):
binfmt_elf: elf_bss no longer used by load_elf_binary()
binfmt_elf: Use elf_load() for interpreter
binfmt_elf: Use elf_load() for library
binfmt_elf: Only report padzero() errors when PROT_WRITE
mm: Remove unused vm_brk()

 fs/binfmt_elf.c    | 214 ++++++++++++++++-----------------------------
 include/linux/mm.h |   3 +-
 mm/mmap.c          |   6 --
 mm/nommu.c         |   5 --
 4 files changed, 76 insertions(+), 152 deletions(-)
Signature · 1 line
2.34.1