svn commit: r315158 - head/sys/vm

Konstantin Belousov kib at FreeBSD.org
Sun Mar 12 13:53:14 UTC 2017


Author: kib
Date: Sun Mar 12 13:53:13 2017
New Revision: 315158
URL: https://svnweb.freebsd.org/changeset/base/315158

Log:
  Follow-up to r313690.
  
  Fix two missed places where vm_object offset to index calculation
  should use unsigned shift, to allow handling of full range of unsigned
  offsets used to create device mappings.
  
  Reported and tested by:	royger (previous version)
  Reviewed by:	alc (previous version)
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Sun Mar 12 13:51:13 2017	(r315157)
+++ head/sys/vm/vm_map.c	Sun Mar 12 13:53:13 2017	(r315158)
@@ -4122,7 +4122,7 @@ RetryLookup:;
 	 * Return the object/offset from this entry.  If the entry was
 	 * copy-on-write or empty, it has been fixed up.
 	 */
-	*pindex = OFF_TO_IDX((vaddr - entry->start) + entry->offset);
+	*pindex = UOFF_TO_IDX((vaddr - entry->start) + entry->offset);
 	*object = entry->object.vm_object;
 
 	*out_prot = prot;
@@ -4203,7 +4203,7 @@ vm_map_lookup_locked(vm_map_t *var_map,	
 	 * Return the object/offset from this entry.  If the entry was
 	 * copy-on-write or empty, it has been fixed up.
 	 */
-	*pindex = OFF_TO_IDX((vaddr - entry->start) + entry->offset);
+	*pindex = UOFF_TO_IDX((vaddr - entry->start) + entry->offset);
 	*object = entry->object.vm_object;
 
 	*out_prot = prot;


More information about the svn-src-head mailing list