aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 459b9f068ad7..8a111792b8db 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1088,6 +1088,17 @@ munmap_back:
1088 error = file->f_op->mmap(file, vma); 1088 error = file->f_op->mmap(file, vma);
1089 if (error) 1089 if (error)
1090 goto unmap_and_free_vma; 1090 goto unmap_and_free_vma;
1091 if ((vma->vm_flags & (VM_SHARED | VM_WRITE | VM_RESERVED))
1092 == (VM_WRITE | VM_RESERVED)) {
1093 printk(KERN_WARNING "program %s is using MAP_PRIVATE, "
1094 "PROT_WRITE mmap of VM_RESERVED memory, which "
1095 "is deprecated. Please report this to "
1096 "linux-kernel@vger.kernel.org\n",current->comm);
1097 if (vma->vm_ops && vma->vm_ops->close)
1098 vma->vm_ops->close(vma);
1099 error = -EACCES;
1100 goto unmap_and_free_vma;
1101 }
1091 } else if (vm_flags & VM_SHARED) { 1102 } else if (vm_flags & VM_SHARED) {
1092 error = shmem_zero_setup(vma); 1103 error = shmem_zero_setup(vma);
1093 if (error) 1104 if (error)