coredump: Snapshot the vmas in do_coredump
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 8 Mar 2022 18:55:29 +0000 (12:55 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 8 Mar 2022 18:55:29 +0000 (12:55 -0600)
commit95c5436a4883841588dae86fb0b9325f47ba5ad3
treea6d8fa5165899d8c8cfd905784f1065e69249c21
parenta99a3e2efaf1f4454eb5c9176f47e66de075b134
coredump: Snapshot the vmas in do_coredump

Move the call of dump_vma_snapshot and kvfree(vma_meta) out of the
individual coredump routines into do_coredump itself.  This makes
the code less error prone and easier to maintain.

Make the vma snapshot available to the coredump routines
in struct coredump_params.  This makes it easier to
change and update what is captures in the vma snapshot
and will be needed for fixing fill_file_notes.

Reviewed-by: Jann Horn <jannh@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/coredump.c
include/linux/coredump.h