Commit 02b1783c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] mprotect_fixup fix

From David M-T.

When this function successfully merges the new range into an existing
VMA, it forgets to extend the new protection mode into the just-merged
pages.
parent 5538fdaa
......@@ -187,7 +187,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
* Try to merge with the previous vma.
*/
if (mprotect_attempt_merge(vma, *pprev, end, newflags))
return 0;
goto success;
} else {
error = split_vma(mm, vma, start, 1);
if (error)
......@@ -209,7 +209,7 @@ mprotect_fixup(struct vm_area_struct *vma, struct vm_area_struct **pprev,
vma->vm_flags = newflags;
vma->vm_page_prot = newprot;
spin_unlock(&mm->page_table_lock);
success:
change_protection(vma, start, end, newprot);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment