aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/madvise.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index af3d573b0141..4e196155a0c3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -168,6 +168,9 @@ static long madvise_remove(struct vm_area_struct *vma,
168 return -EINVAL; 168 return -EINVAL;
169 } 169 }
170 170
171 if ((vma->vm_flags & (VM_SHARED|VM_WRITE)) != (VM_SHARED|VM_WRITE))
172 return -EACCES;
173
171 mapping = vma->vm_file->f_mapping; 174 mapping = vma->vm_file->f_mapping;
172 175
173 offset = (loff_t)(start - vma->vm_start) 176 offset = (loff_t)(start - vma->vm_start)