linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] make mprotect() work again
@ 2002-09-25 23:00 David Mosberger
  2002-09-25 23:19 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: David Mosberger @ 2002-09-25 23:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

This patch:

 ChangeSet@1.536.31.4, 2002-09-17 20:35:47-07:00, akpm@digeo.com
  [PATCH] consolidate the VMA splitting code

broke mprotect().  The patch below makes it work again.

	--david

===== mm/mprotect.c 1.16 vs edited =====
--- 1.16/mm/mprotect.c	Tue Sep 17 11:05:14 2002
+++ edited/mm/mprotect.c	Wed Sep 25 15:48:39 2002
@@ -186,8 +186,10 @@
 		/*
 		 * Try to merge with the previous vma.
 		 */
-		if (mprotect_attempt_merge(vma, *pprev, end, newflags))
+		if (mprotect_attempt_merge(vma, *pprev, end, newflags)) {
+			change_protection(vma, start, end, newprot);
 			return 0;
+		}
 	} else {
 		error = split_vma(mm, vma, start, 1);
 		if (error)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] make mprotect() work again
  2002-09-25 23:00 [patch] make mprotect() work again David Mosberger
@ 2002-09-25 23:19 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2002-09-25 23:19 UTC (permalink / raw)
  To: davidm; +Cc: linux-kernel

David Mosberger wrote:
> 
> This patch:
> 
>  ChangeSet@1.536.31.4, 2002-09-17 20:35:47-07:00, akpm@digeo.com
>   [PATCH] consolidate the VMA splitting code
> 
> broke mprotect().  The patch below makes it work again.
> 

Thanks.  Yet another victim of the return-from-the-middle-of-a-function
disease.

I'll send this:


--- 2.5.38/mm/mprotect.c~mprotect-fix	Wed Sep 25 16:16:14 2002
+++ 2.5.38-akpm/mm/mprotect.c	Wed Sep 25 16:16:35 2002
@@ -187,7 +187,7 @@ mprotect_fixup(struct vm_area_struct *vm
 		 * 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 *vm
 	vma->vm_flags = newflags;
 	vma->vm_page_prot = newprot;
 	spin_unlock(&mm->page_table_lock);
-
+success:
 	change_protection(vma, start, end, newprot);
 	return 0;
 

.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-25 23:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-25 23:00 [patch] make mprotect() work again David Mosberger
2002-09-25 23:19 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).