svn commit: r316686 - head/sys/vm

Mark Johnston markj at FreeBSD.org
Mon Apr 10 20:55:44 UTC 2017


Author: markj
Date: Mon Apr 10 20:55:42 2017
New Revision: 316686
URL: https://svnweb.freebsd.org/changeset/base/316686

Log:
  Add some bounds assertions to the vm_map_entry clip functions.
  
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	Dell EMC Isilon
  X-Differential Revision: https://reviews.freebsd.org/D10349

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Mon Apr 10 19:22:15 2017	(r316685)
+++ head/sys/vm/vm_map.c	Mon Apr 10 20:55:42 2017	(r316686)
@@ -1655,6 +1655,8 @@ _vm_map_clip_start(vm_map_t map, vm_map_
 	vm_map_entry_t new_entry;
 
 	VM_MAP_ASSERT_LOCKED(map);
+	KASSERT(entry->end > start && entry->start < start,
+	    ("_vm_map_clip_start: invalid clip of entry %p", entry));
 
 	/*
 	 * Split off the front portion -- note that we must insert the new
@@ -1739,6 +1741,8 @@ _vm_map_clip_end(vm_map_t map, vm_map_en
 	vm_map_entry_t new_entry;
 
 	VM_MAP_ASSERT_LOCKED(map);
+	KASSERT(entry->start < end && entry->end > end,
+	    ("_vm_map_clip_end: invalid clip of entry %p", entry));
 
 	/*
 	 * If there is no object backing this entry, we might as well create


More information about the svn-src-all mailing list