summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2002-09-25 07:06:59 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-09-25 07:06:59 -0700
commit02b1783c697786c1ac2bcaa892649ec0d27587bc (patch)
tree00f87b37b20c9f1391621380bb9ae517815d94c0
parent5538fdaaa03a0fac812ddb82674d7c3e9e6b0972 (diff)
[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.
-rw-r--r--mm/mprotect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c
index fc1e3345d38b..be0096238437 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -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;