mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
fix mprotect vma_wants_writenotify prot
Fix mprotect bug in recent commit 3ed75eb8f1
(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 <[email protected]>
Cc: Coly Li <[email protected]>
Cc: Tony Luck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4ae3f847e4
commit
1ddd439ef9
2 changed files with 2 additions and 3 deletions
|
|
@ -1171,8 +1171,7 @@ munmap_back:
|
|||
vm_flags = vma->vm_flags;
|
||||
|
||||
if (vma_wants_writenotify(vma))
|
||||
vma->vm_page_prot =
|
||||
protection_map[vm_flags & (VM_READ|VM_WRITE|VM_EXEC)];
|
||||
vma->vm_page_prot = vm_get_page_prot(vm_flags & ~VM_SHARED);
|
||||
|
||||
if (!file || !vma_merge(mm, prev, addr, vma->vm_end,
|
||||
vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue