1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SCHED_COREDUMP_H
3 #define _LINUX_SCHED_COREDUMP_H
5 #include <linux/mm_types.h>
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 */
11 extern void set_dumpable(struct mm_struct
*mm
, int value
);
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
18 static inline int __get_dumpable(unsigned long mm_flags
)
20 return mm_flags
& MMF_DUMPABLE_MASK
;
23 static inline int get_dumpable(struct mm_struct
*mm
)
25 return __get_dumpable(mm
->flags
);
28 #endif /* _LINUX_SCHED_COREDUMP_H */