coredump: Snapshot the vmas in do_coredump
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 8 Mar 2022 18:55:29 +0000 (12:55 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:40:44 +0000 (14:40 +0200)
commit936c8be4d1447f36ac4d2a464bd03a5cd659c42f
tree6b21d6ed645fe75796d79639df819f851d65874f
parent5318cdf4fd834856ce71238b064f35386f9ef528
coredump: Snapshot the vmas in do_coredump

commit 95c5436a4883841588dae86fb0b9325f47ba5ad3 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/coredump.c
include/linux/binfmts.h
include/linux/coredump.h