Skip to content

RFC coredump cleanups

Al Viro linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest13 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13restore 32bit aout coredumparch/x86/ia32/ia32_aout.c+36 -340 replies
2/13new helper: dump_emit()fs/binfmt_elf.c fs/coredump.c include/linux/binfmts.h +1 more+41 -380 replies
3/13switch elf_core_write_extra_phdrs() to dump_emit()arch/ia64/kernel/elfcore.c arch/x86/um/elfcore.c fs/binfmt_elf.c +3 more+15 -210 replies
4/13switch elf_core_write_extra_data() to dump_emit()arch/ia64/kernel/elfcore.c arch/x86/um/elfcore.c fs/binfmt_elf.c +2 more+11 -130 replies
5/13binfmt_elf: convert writing actual dump pages to dump_emit()fs/binfmt_elf.c+3 -110 replies
6/13convert the rest of binfmt_elf_fdpic to dump_emit()fs/binfmt_elf_fdpic.c+31 -780 replies
7/13switch elf_coredump_extra_notes_write() to dump_emit()arch/powerpc/include/asm/spu.h arch/powerpc/platforms/cell/spu_syscalls.c arch/powerpc/platforms/cell/spufs/coredump.c +3 more+30 -380 replies
8/13aout: switch to dump_emitarch/x86/ia32/ia32_aout.c fs/binfmt_aout.c+11 -160 replies
9/13binfmt_elf: count notes towards coredump limitfs/binfmt_elf.c+0 -30 replies
10/13make dump_emit() use vfs_write() instead of banging at ->f_op->write directlyfs/coredump.c+12 -56 replies
11/13dump_skip(): dump_seek() replacement taking coredump_paramsarch/x86/ia32/ia32_aout.c fs/binfmt_aout.c fs/binfmt_elf.c +3 more+22 -431 reply
12/13spufs: get rid of dump_emit() wrappersarch/powerpc/platforms/cell/spufs/coredump.c+20 -490 replies
13/13new helper: dump_align()arch/powerpc/platforms/cell/spufs/coredump.c fs/binfmt_elf.c fs/binfmt_elf_fdpic.c +2 more+12 -170 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 00/13] coredump cleanups

This series tries to regularize the coredump writes/seeks/rlimit handling
etc. Quite a bit of boilerplate code removed, another open-coded caller of ->write() converted to use of normal codepath (which was the original reason I've got into that mess). RLIMIT_CORE handling got a lot more uniform, short writes handling fixed (we had weird cases where a very large ->write() to pipe might happen and where short write had been treated as an error).

It needs more testing; I don't have any test setups that could deal
with spufs, for example, and while it seems to produce normal coredumps on what I have tested, I'd still like more eyes on it.

The same series is in the tip of vfs.git#experimental, so if you prefer
git access for review...

Shortlog:
restore 32bit aout coredump
new helper: dump_emit()
switch elf_core_write_extra_phdrs() to dump_emit()
switch elf_core_write_extra_data() to dump_emit()
binfmt_elf: convert writing actual dump pages to dump_emit() convert the rest of binfmt_elf_fdpic to dump_emit()
switch elf_coredump_extra_notes_write() to dump_emit()
aout: switch to dump_emit
binfmt_elf: count notes towards coredump limit
make dump_emit() use vfs_write() instead of banging at ->f_op->write directly dump_skip(): dump_seek() replacement taking coredump_params
spufs: get rid of dump_emit() wrappers
new helper: dump_align()

Diffstat:

 arch/ia64/kernel/elfcore.c                   |   12 +--
 arch/powerpc/include/asm/spu.h               |    3 +-
 arch/powerpc/platforms/cell/spu_syscalls.c   |    5 +-
 arch/powerpc/platforms/cell/spufs/coredump.c |   89 ++++++--------------
 arch/powerpc/platforms/cell/spufs/spufs.h    |    3 +-
 arch/x86/ia32/ia32_aout.c                    |   86 ++++++++++----------
 arch/x86/um/elfcore.c                        |   15 +---
 fs/binfmt_aout.c                             |    9 +-
 fs/binfmt_elf.c                              |   84 ++++++-------------
 fs/binfmt_elf_fdpic.c                        |  114 +++++++-------------------
 fs/coredump.c                                |   64 +++++++++------
 include/linux/binfmts.h                      |    1 +
 include/linux/coredump.h                     |    6 +-
 include/linux/elf.h                          |    6 +-
 include/linux/elfcore.h                      |    7 +-
 kernel/elfcore.c                             |   10 +--
 16 files changed, 196 insertions(+), 318 deletions(-)