diff options
Diffstat (limited to 'mm/madvise.c')
-rw-r--r-- | mm/madvise.c | 8 |
1 files changed, 6 insertions, 2 deletions
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: |