Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm fix UVM_MAP_CLIP_* to only clip if the clip address ...



details:   https://anonhg.NetBSD.org/src/rev/e4e4d903cf60
branches:  trunk
changeset: 772915:e4e4d903cf60
user:      chs <chs%NetBSD.org@localhost>
date:      Sat Jan 21 16:51:38 2012 +0000

description:
fix UVM_MAP_CLIP_* to only clip if the clip address is within the entry
(which would only not be true if the clip address is at one of the boundaries
of the entry).  fixes PR 44788.

diffstat:

 sys/uvm/uvm_map.h |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r aee7eeca9a03 -r e4e4d903cf60 sys/uvm/uvm_map.h
--- a/sys/uvm/uvm_map.h Sat Jan 21 16:49:26 2012 +0000
+++ b/sys/uvm/uvm_map.h Sat Jan 21 16:51:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.h,v 1.68 2011/12/20 15:41:01 reinoud Exp $     */
+/*     $NetBSD: uvm_map.h,v 1.69 2012/01/21 16:51:38 chs Exp $ */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -82,7 +82,10 @@
  */
 
 #define UVM_MAP_CLIP_START(MAP,ENTRY,VA,UMR) { \
-       if ((VA) > (ENTRY)->start) uvm_map_clip_start(MAP,ENTRY,VA,UMR); }
+       if ((VA) > (ENTRY)->start && (VA) < (ENTRY)->end) { \
+               uvm_map_clip_start(MAP,ENTRY,VA,UMR); \
+       } \
+}
 
 /*
  * UVM_MAP_CLIP_END: ensure that the entry ends at or before
@@ -92,7 +95,10 @@
  */
 
 #define UVM_MAP_CLIP_END(MAP,ENTRY,VA,UMR) { \
-       if ((VA) < (ENTRY)->end) uvm_map_clip_end(MAP,ENTRY,VA,UMR); }
+       if ((VA) > (ENTRY)->start && (VA) < (ENTRY)->end) { \
+               uvm_map_clip_end(MAP,ENTRY,VA,UMR); \
+       } \
+} 
 
 /*
  * extract flags



Home | Main Index | Thread Index | Old Index