This source file includes following definitions.
- __get_dumpable
- get_dumpable
1
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
8 #define SUID_DUMP_USER 1
9 #define SUID_DUMP_ROOT 2
10
11
12
13
14 #define MMF_DUMPABLE_BITS 2
15 #define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1)
16
17 extern void set_dumpable(struct mm_struct *mm, int value);
18
19
20
21
22
23
24 static inline int __get_dumpable(unsigned long mm_flags)
25 {
26 return mm_flags & MMF_DUMPABLE_MASK;
27 }
28
29 static inline int get_dumpable(struct mm_struct *mm)
30 {
31 return __get_dumpable(mm->flags);
32 }
33
34
35 #define MMF_DUMP_ANON_PRIVATE 2
36 #define MMF_DUMP_ANON_SHARED 3
37 #define MMF_DUMP_MAPPED_PRIVATE 4
38 #define MMF_DUMP_MAPPED_SHARED 5
39 #define MMF_DUMP_ELF_HEADERS 6
40 #define MMF_DUMP_HUGETLB_PRIVATE 7
41 #define MMF_DUMP_HUGETLB_SHARED 8
42 #define MMF_DUMP_DAX_PRIVATE 9
43 #define MMF_DUMP_DAX_SHARED 10
44
45 #define MMF_DUMP_FILTER_SHIFT MMF_DUMPABLE_BITS
46 #define MMF_DUMP_FILTER_BITS 9
47 #define MMF_DUMP_FILTER_MASK \
48 (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
49 #define MMF_DUMP_FILTER_DEFAULT \
50 ((1 << MMF_DUMP_ANON_PRIVATE) | (1 << MMF_DUMP_ANON_SHARED) |\
51 (1 << MMF_DUMP_HUGETLB_PRIVATE) | MMF_DUMP_MASK_DEFAULT_ELF)
52
53 #ifdef CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS
54 # define MMF_DUMP_MASK_DEFAULT_ELF (1 << MMF_DUMP_ELF_HEADERS)
55 #else
56 # define MMF_DUMP_MASK_DEFAULT_ELF 0
57 #endif
58
59 #define MMF_VM_MERGEABLE 16
60 #define MMF_VM_HUGEPAGE 17
61
62
63
64
65
66
67 #define MMF_HAS_UPROBES 19
68 #define MMF_RECALC_UPROBES 20
69 #define MMF_OOM_SKIP 21
70 #define MMF_UNSTABLE 22
71 #define MMF_HUGE_ZERO_PAGE 23
72 #define MMF_DISABLE_THP 24
73 #define MMF_OOM_VICTIM 25
74 #define MMF_OOM_REAP_QUEUED 26
75 #define MMF_DISABLE_THP_MASK (1 << MMF_DISABLE_THP)
76
77 #define MMF_INIT_MASK (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
78 MMF_DISABLE_THP_MASK)
79
80 #endif