summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2022-03-08 12:55:29 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 14:40:44 +0200
commit936c8be4d1447f36ac4d2a464bd03a5cd659c42f (patch)
tree6b21d6ed645fe75796d79639df819f851d65874f /include
parent5318cdf4fd834856ce71238b064f35386f9ef528 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/binfmts.h3
-rw-r--r--include/linux/coredump.h3
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 0571701ab1c5..5a9786e6b554 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -82,6 +82,9 @@ struct coredump_params {
unsigned long mm_flags;
loff_t written;
loff_t pos;
+ int vma_count;
+ size_t vma_data_size;
+ struct core_vma_metadata *vma_meta;
};
/*
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index e58e8c207782..9c1fd6241307 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -24,9 +24,6 @@ extern int dump_align(struct coredump_params *cprm, int align);
extern void dump_truncate(struct coredump_params *cprm);
int dump_user_range(struct coredump_params *cprm, unsigned long start,
unsigned long len);
-int dump_vma_snapshot(struct coredump_params *cprm, int *vma_count,
- struct core_vma_metadata **vma_meta,
- size_t *vma_data_size_ptr);
#ifdef CONFIG_COREDUMP
extern void do_coredump(const kernel_siginfo_t *siginfo);
#else