1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef _LINUX_SCHED_COREDUMP_H 3 #define _LINUX_SCHED_COREDUMP_H 4 5 #include <linux/mm_types.h> 6 7 #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 8 #define SUID_DUMP_USER 1 /* Dump as user of process */ 9 #define SUID_DUMP_ROOT 2 /* Dump as root */ 10 11 extern void set_dumpable(struct mm_struct *mm, int value); 12 /* 13 * This returns the actual value of the suid_dumpable flag. For things 14 * that are using this for checking for privilege transitions, it must 15 * test against SUID_DUMP_USER rather than treating it as a boolean 16 * value. 17 */ __get_dumpable(unsigned long mm_flags)18static inline int __get_dumpable(unsigned long mm_flags) 19 { 20 return mm_flags & MMF_DUMPABLE_MASK; 21 } 22 get_dumpable(struct mm_struct * mm)23static inline int get_dumpable(struct mm_struct *mm) 24 { 25 return __get_dumpable(mm->flags); 26 } 27 28 #endif /* _LINUX_SCHED_COREDUMP_H */ 29