#define MADV_HUGEPAGE  14              /* Worth backing with hugepages */
 #define MADV_NOHUGEPAGE        15              /* Not worth backing with hugepages */
 
+#define MADV_DONTDUMP   16             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    17              /* Clear the MADV_NODUMP flag */
+
 /* compatibility flags */
 #define MAP_FILE       0
 
 
 #define MADV_HUGEPAGE  14              /* Worth backing with hugepages */
 #define MADV_NOHUGEPAGE        15              /* Not worth backing with hugepages */
 
+#define MADV_DONTDUMP   16             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    17              /* Clear the MADV_NODUMP flag */
+
 /* compatibility flags */
 #define MAP_FILE       0
 
 
 #define MADV_HUGEPAGE  67              /* Worth backing with hugepages */
 #define MADV_NOHUGEPAGE        68              /* Not worth backing with hugepages */
 
+#define MADV_DONTDUMP   69             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    70              /* Clear the MADV_NODUMP flag */
+
 /* compatibility flags */
 #define MAP_FILE       0
 #define MAP_VARIABLE   0
 
 #define MADV_HUGEPAGE  14              /* Worth backing with hugepages */
 #define MADV_NOHUGEPAGE        15              /* Not worth backing with hugepages */
 
+#define MADV_DONTDUMP   16             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    17              /* Clear the MADV_NODUMP flag */
+
 /* compatibility flags */
 #define MAP_FILE       0
 
 
        if (always_dump_vma(vma))
                goto whole;
 
+       if (vma->vm_flags & VM_NODUMP)
+               return 0;
+
        /* Hugetlb memory check */
        if (vma->vm_flags & VM_HUGETLB) {
                if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
 
 #define MADV_HUGEPAGE  14              /* Worth backing with hugepages */
 #define MADV_NOHUGEPAGE        15              /* Not worth backing with hugepages */
 
+#define MADV_DONTDUMP   16             /* Explicity exclude from the core dump,
+                                          overrides the coredump filter bits */
+#define MADV_DODUMP    17              /* Clear the MADV_NODUMP flag */
+
 /* compatibility flags */
 #define MAP_FILE       0
 
 
 #define VM_HUGEPAGE    0x01000000      /* MADV_HUGEPAGE marked this vma */
 #endif
 #define VM_INSERTPAGE  0x02000000      /* The vma has had "vm_insert_page()" done on it */
+#define VM_NODUMP      0x04000000      /* Do not include in the core dump */
 
 #define VM_CAN_NONLINEAR 0x08000000    /* Has ->fault & does nonlinear pages */
 #define VM_MIXEDMAP    0x10000000      /* Can contain "struct page" and pure PFN pages */
 
                }
                new_flags &= ~VM_DONTCOPY;
                break;
+       case MADV_DONTDUMP:
+               new_flags |= VM_NODUMP;
+               break;
+       case MADV_DODUMP:
+               new_flags &= ~VM_NODUMP;
+               break;
        case MADV_MERGEABLE:
        case MADV_UNMERGEABLE:
                error = ksm_madvise(vma, start, end, behavior, &new_flags);
        case MADV_HUGEPAGE:
        case MADV_NOHUGEPAGE:
 #endif
+       case MADV_DONTDUMP:
+       case MADV_DODUMP:
                return 1;
 
        default: