Page MenuHomeFreeBSD

D39845.diff
No OneTemporary

D39845.diff

diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2247,8 +2247,15 @@
rv = vm_map_insert(map, object, offset, *addr, *addr + length,
prot, max, cow);
}
- if (rv == KERN_SUCCESS && update_anon)
- map->anon_loc = *addr + length;
+
+ /*
+ * Update the starting address for clustered anonymous memory mappings
+ * if a starting address was not previously defined or an ASLR restart
+ * placed an anonymous memory mapping at a lower address.
+ */
+ if (update_anon && rv == KERN_SUCCESS && (map->anon_loc == 0 ||
+ *addr < map->anon_loc))
+ map->anon_loc = *addr;
done:
vm_map_unlock(map);
return (rv);
@@ -4041,9 +4048,6 @@
entry->object.vm_object != NULL)
pmap_map_delete(map->pmap, entry->start, entry->end);
- if (entry->end == map->anon_loc)
- map->anon_loc = entry->start;
-
/*
* Delete the entry only after removing all pmap
* entries pointing to its pages. (Otherwise, its

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 1, 7:24 PM (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13206904
Default Alt Text
D39845.diff (976 B)

Event Timeline