diff options
author | Hugh Dickins <hugh@veritas.com> | 2007-10-23 05:45:12 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 17:32:06 +0200 |
commit | 1ddd439ef987c9f0209e6ce824b67518f2afe67b (patch) | |
tree | 1f6e0ef40c2b9cf5819d9193d7d06c6a0a33ff6c /mm/mprotect.c | |
parent | md: raid5: fix clearing of biofill operations (diff) | |
download | linux-1ddd439ef987c9f0209e6ce824b67518f2afe67b.tar.xz linux-1ddd439ef987c9f0209e6ce824b67518f2afe67b.zip |
fix mprotect vma_wants_writenotify prot
Fix mprotect bug in recent commit 3ed75eb8f1cd89565966599c4f77d2edb086d5b0
(setup vma->vm_page_prot by vm_get_page_prot()): the vma_wants_writenotify
case was setting the same prot as when not.
Nothing wrong with the use of protection_map[] in mmap_region(),
but use vm_get_page_prot() there too in the same ~VM_SHARED way.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Coly Li <coyli@suse.de>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r-- | mm/mprotect.c | 2 |
1 files changed, 1 insertions, 1 deletions
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: vma->vm_flags = newflags; vma->vm_page_prot = vm_get_page_prot(newflags); if (vma_wants_writenotify(vma)) { - vma->vm_page_prot = vm_get_page_prot(newflags); + vma->vm_page_prot = vm_get_page_prot(newflags & ~VM_SHARED); dirty_accountable = 1; } |