]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
coredump: Snapshot the vmas in do_coredump
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 8 Mar 2022 18:55:29 +0000 (12:55 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:02 +0000 (11:59 +0200)
commit4a726800476a1bbc14a911ae5a08948c8b5d406e
tree09de13b3c4eca5da57545f316bb05212a984fbb9
parent62f822f91f3b8197df39d936342c31ed8a73078f
coredump: Snapshot the vmas in do_coredump

BugLink: https://bugs.launchpad.net/bugs/1969110
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>
(cherry picked from commit f6ca862806df3762170cd3251852330304e781c9)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/coredump.c
include/linux/binfmts.h
include/linux/coredump.h