diff options
author | kib <kib@FreeBSD.org> | 2013-12-27 16:59:47 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-12-27 16:59:47 +0000 |
commit | 2e35793d0faf24406507031069cd84ab4d49adb2 (patch) | |
tree | 56e66c194096f0277c343de57694fea3e981bbec | |
parent | 04e69c32ce0e0f762aace37db8b9749e1add82b5 (diff) | |
download | FreeBSD-src-2e35793d0faf24406507031069cd84ab4d49adb2.zip FreeBSD-src-2e35793d0faf24406507031069cd84ab4d49adb2.tar.gz |
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
-rw-r--r-- | sys/vm/vm_map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index e3842a3..e15e0ca 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1207,6 +1207,7 @@ charged: } 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) || |