aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/mmap.c3
-rw-r--r--mm/mprotect.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index 7a30c4988231..facc1a75bd4f 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1171,8 +1171,7 @@ munmap_back:
1171 vm_flags = vma->vm_flags; 1171 vm_flags = vma->vm_flags;
1172 1172
1173 if (vma_wants_writenotify(vma)) 1173 if (vma_wants_writenotify(vma))
1174 vma->vm_page_prot = 1174 vma->vm_page_prot = vm_get_page_prot(vm_flags & ~VM_SHARED);
1175 protection_map[vm_flags & (VM_READ|VM_WRITE|VM_EXEC)];
1176 1175
1177 if (!file || !vma_merge(mm, prev, addr, vma->vm_end, 1176 if (!file || !vma_merge(mm, prev, addr, vma->vm_end,
1178 vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) { 1177 vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 55227845abbe..4de546899dc1 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -194,7 +194,7 @@ success:
194 vma->vm_flags = newflags; 194 vma->vm_flags = newflags;
195 vma->vm_page_prot = vm_get_page_prot(newflags); 195 vma->vm_page_prot = vm_get_page_prot(newflags);
196 if (vma_wants_writenotify(vma)) { 196 if (vma_wants_writenotify(vma)) {
197 vma->vm_page_prot = vm_get_page_prot(newflags); 197 vma->vm_page_prot = vm_get_page_prot(newflags & ~VM_SHARED);
198 dirty_accountable = 1; 198 dirty_accountable = 1;
199 } 199 }
200 200