Contributors: 25
Author Tokens Token Proportion Commits Commit Proportion
Linus Torvalds (pre-git) 35 12.64% 11 21.15%
Jann Horn 34 12.27% 3 5.77%
Roman Kisel 33 11.91% 1 1.92%
Al Viro 30 10.83% 5 9.62%
Eric W. Biedermann 22 7.94% 6 11.54%
Daisuke Hatayama 19 6.86% 1 1.92%
Alex Kelly 19 6.86% 2 3.85%
Masami Hiramatsu 17 6.14% 2 3.85%
nixiaoming 11 3.97% 1 1.92%
Christian Brauner 7 2.53% 2 3.85%
David Howells 6 2.17% 2 3.85%
Denys Vlasenko 6 2.17% 1 1.92%
Linus Torvalds 5 1.81% 2 3.85%
Allen Pais 5 1.81% 1 1.92%
Kees Cook 4 1.44% 2 3.85%
Adrian Bunk 4 1.44% 1 1.92%
Luis R. Rodriguez 4 1.44% 1 1.92%
Richard Weinberger 3 1.08% 1 1.92%
Oleksandr Natalenko 3 1.08% 1 1.92%
Mateusz Guzik 3 1.08% 1 1.92%
Andrew Morton 2 0.72% 1 1.92%
Arnd Bergmann 2 0.72% 1 1.92%
Greg Kroah-Hartman 1 0.36% 1 1.92%
Oleg Nesterov 1 0.36% 1 1.92%
Lorenzo Stoakes 1 0.36% 1 1.92%
Total 277 52


/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_COREDUMP_H
#define _LINUX_COREDUMP_H

#include <linux/types.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <asm/siginfo.h>

#ifdef CONFIG_COREDUMP
struct core_vma_metadata {
	unsigned long start, end;
	vm_flags_t flags;
	unsigned long dump_size;
	unsigned long pgoff;
	struct file   *file;
};

struct coredump_params {
	const kernel_siginfo_t *siginfo;
	struct file *file;
	unsigned long limit;
	unsigned long mm_flags;
	int cpu;
	loff_t written;
	loff_t pos;
	loff_t to_skip;
	int vma_count;
	size_t vma_data_size;
	struct core_vma_metadata *vma_meta;
	struct pid *pid;
};

extern unsigned int core_file_note_size_limit;

/*
 * These are the only things you should do on a core-file: use only these
 * functions to write out all the necessary info.
 */
extern void dump_skip_to(struct coredump_params *cprm, unsigned long to);
extern void dump_skip(struct coredump_params *cprm, size_t nr);
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);
extern void vfs_coredump(const kernel_siginfo_t *siginfo);

/*
 * Logging for the coredump code, ratelimited.
 * The TGID and comm fields are added to the message.
 */

#define __COREDUMP_PRINTK(Level, Format, ...) \
	do {	\
		char comm[TASK_COMM_LEN];	\
		/* This will always be NUL terminated. */ \
		memcpy(comm, current->comm, sizeof(comm)); \
		printk_ratelimited(Level "coredump: %d(%*pE): " Format "\n",	\
			task_tgid_vnr(current), (int)strlen(comm), comm, ##__VA_ARGS__);	\
	} while (0)	\

#define coredump_report(fmt, ...) __COREDUMP_PRINTK(KERN_INFO, fmt, ##__VA_ARGS__)
#define coredump_report_failure(fmt, ...) __COREDUMP_PRINTK(KERN_WARNING, fmt, ##__VA_ARGS__)

#else
static inline void vfs_coredump(const kernel_siginfo_t *siginfo) {}

#define coredump_report(...)
#define coredump_report_failure(...)

#endif

#if defined(CONFIG_COREDUMP) && defined(CONFIG_SYSCTL)
extern void validate_coredump_safety(void);
#else
static inline void validate_coredump_safety(void) {}
#endif

#endif /* _LINUX_COREDUMP_H */