diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2022-03-08 21:55:29 +0300 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2022-03-08 21:55:29 +0300 |
commit | 95c5436a4883841588dae86fb0b9325f47ba5ad3 (patch) | |
tree | a6d8fa5165899d8c8cfd905784f1065e69249c21 /include/linux/coredump.h | |
parent | a99a3e2efaf1f4454eb5c9176f47e66de075b134 (diff) | |
download | linux-95c5436a4883841588dae86fb0b9325f47ba5ad3.tar.xz |
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>
Diffstat (limited to 'include/linux/coredump.h')
-rw-r--r-- | include/linux/coredump.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index 2ee1460a1d66..7d05370e555e 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h @@ -23,6 +23,9 @@ struct coredump_params { loff_t written; loff_t pos; loff_t to_skip; + int vma_count; + size_t vma_data_size; + struct core_vma_metadata *vma_meta; }; /* @@ -35,9 +38,6 @@ extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr); extern int dump_align(struct coredump_params *cprm, int align); 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); extern void do_coredump(const kernel_siginfo_t *siginfo); #else static inline void do_coredump(const kernel_siginfo_t *siginfo) {} |