diff options
-rw-r--r-- | fs/binfmt_elf.c | 2 | ||||
-rw-r--r-- | include/linux/mm.h | 2 | ||||
-rw-r--r-- | mm/madvise.c | 8 |
3 files changed, 8 insertions, 4 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 28a64e769527..2b72d26e2e4b 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1123,7 +1123,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma, | |||
1123 | if (always_dump_vma(vma)) | 1123 | if (always_dump_vma(vma)) |
1124 | goto whole; | 1124 | goto whole; |
1125 | 1125 | ||
1126 | if (vma->vm_flags & VM_NODUMP) | 1126 | if (vma->vm_flags & VM_DONTDUMP) |
1127 | return 0; | 1127 | return 0; |
1128 | 1128 | ||
1129 | /* Hugetlb memory check */ | 1129 | /* Hugetlb memory check */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 25ef49c1f2bd..dc08d558e058 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -102,7 +102,7 @@ extern unsigned int kobjsize(const void *objp); | |||
102 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ | 102 | #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ |
103 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ | 103 | #define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ |
104 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ | 104 | #define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ |
105 | #define VM_NODUMP 0x04000000 /* Do not include in the core dump */ | 105 | #define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ |
106 | 106 | ||
107 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ | 107 | #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ |
108 | #define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */ | 108 | #define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */ |
diff --git a/mm/madvise.c b/mm/madvise.c index 14d260fa0d17..03dfa5c7adb3 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -69,10 +69,14 @@ static long madvise_behavior(struct vm_area_struct * vma, | |||
69 | new_flags &= ~VM_DONTCOPY; | 69 | new_flags &= ~VM_DONTCOPY; |
70 | break; | 70 | break; |
71 | case MADV_DONTDUMP: | 71 | case MADV_DONTDUMP: |
72 | new_flags |= VM_NODUMP; | 72 | new_flags |= VM_DONTDUMP; |
73 | break; | 73 | break; |
74 | case MADV_DODUMP: | 74 | case MADV_DODUMP: |
75 | new_flags &= ~VM_NODUMP; | 75 | if (new_flags & VM_SPECIAL) { |
76 | error = -EINVAL; | ||
77 | goto out; | ||
78 | } | ||
79 | new_flags &= ~VM_DONTDUMP; | ||
76 | break; | 80 | break; |
77 | case MADV_MERGEABLE: | 81 | case MADV_MERGEABLE: |
78 | case MADV_UNMERGEABLE: | 82 | case MADV_UNMERGEABLE: |