~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/sched/coredump.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 /* mm flags */
 12 
 13 /* for SUID_DUMP_* above */
 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  * This returns the actual value of the suid_dumpable flag. For things
 20  * that are using this for checking for privilege transitions, it must
 21  * test against SUID_DUMP_USER rather than treating it as a boolean
 22  * value.
 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 /* coredump filter bits */
 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                                         /* leave room for more dump flags */
 59 #define MMF_VM_MERGEABLE        16      /* KSM may merge identical pages */
 60 #define MMF_VM_HUGEPAGE         17      /* set when mm is available for
 61                                            khugepaged */
 62 /*
 63  * This one-shot flag is dropped due to necessity of changing exe once again
 64  * on NFS restore
 65  */
 66 //#define MMF_EXE_FILE_CHANGED  18      /* see prctl_set_mm_exe_file() */
 67 
 68 #define MMF_HAS_UPROBES         19      /* has uprobes */
 69 #define MMF_RECALC_UPROBES      20      /* MMF_HAS_UPROBES can be wrong */
 70 #define MMF_OOM_SKIP            21      /* mm is of no interest for the OOM killer */
 71 #define MMF_UNSTABLE            22      /* mm is unstable for copy_from_user */
 72 #define MMF_HUGE_ZERO_PAGE      23      /* mm has ever used the global huge zero page */
 73 #define MMF_DISABLE_THP         24      /* disable THP for all VMAs */
 74 #define MMF_DISABLE_THP_MASK    (1 << MMF_DISABLE_THP)
 75 #define MMF_OOM_REAP_QUEUED     25      /* mm was queued for oom_reaper */
 76 #define MMF_MULTIPROCESS        26      /* mm is shared between processes */
 77 /*
 78  * MMF_HAS_PINNED: Whether this mm has pinned any pages.  This can be either
 79  * replaced in the future by mm.pinned_vm when it becomes stable, or grow into
 80  * a counter on its own. We're aggresive on this bit for now: even if the
 81  * pinned pages were unpinned later on, we'll still keep this bit set for the
 82  * lifecycle of this mm, just for simplicity.
 83  */
 84 #define MMF_HAS_PINNED          27      /* FOLL_PIN has run, never cleared */
 85 
 86 #define MMF_HAS_MDWE            28
 87 #define MMF_HAS_MDWE_MASK       (1 << MMF_HAS_MDWE)
 88 
 89 
 90 #define MMF_HAS_MDWE_NO_INHERIT 29
 91 
 92 #define MMF_VM_MERGE_ANY        30
 93 #define MMF_VM_MERGE_ANY_MASK   (1 << MMF_VM_MERGE_ANY)
 94 
 95 #define MMF_TOPDOWN             31      /* mm searches top down by default */
 96 #define MMF_TOPDOWN_MASK        (1 << MMF_TOPDOWN)
 97 
 98 #define MMF_INIT_MASK           (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK |\
 99                                  MMF_DISABLE_THP_MASK | MMF_HAS_MDWE_MASK |\
100                                  MMF_VM_MERGE_ANY_MASK | MMF_TOPDOWN_MASK)
101 
102 static inline unsigned long mmf_init_flags(unsigned long flags)
103 {
104         if (flags & (1UL << MMF_HAS_MDWE_NO_INHERIT))
105                 flags &= ~((1UL << MMF_HAS_MDWE) |
106                            (1UL << MMF_HAS_MDWE_NO_INHERIT));
107         return flags & MMF_INIT_MASK;
108 }
109 
110 #endif /* _LINUX_SCHED_COREDUMP_H */
111 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php