Do not coalesce stack entry, vm_map_stack() asserts that the requested

region is claimed by a new entry.

Pass MAP_STACK_GROWS_DOWN and MAP_STACK_GROWS_UP flags to
vm_map_insert() from vm_map_stack(), to really turn off coalescing
code and call to vm_map_simplify_entry() [1].

Reported by:	avg, peter, many
Tested by:	avg, peter
Noted by:	avg [1]
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2013-12-27 16:59:47 +00:00
parent d3178d7d27
commit b61a53d43d

View File

@ -1207,6 +1207,7 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
}
else if ((prev_entry != &map->header) &&
(prev_entry->eflags == protoeflags) &&
(cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 &&
(prev_entry->end == start) &&
(prev_entry->wired_count == 0) &&
(prev_entry->cred == cred ||
@ -3339,7 +3340,6 @@ vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize,
* NOTE: We explicitly allow bi-directional stacks.
*/
orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP);
cow &= ~orient;
KASSERT(orient != 0, ("No stack grow direction"));
if (addrbos < vm_map_min(map) ||