diff options
author | alc <alc@FreeBSD.org> | 1999-06-17 05:49:00 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-06-17 05:49:00 +0000 |
commit | 2f13d2c4a2e4abc8f885d9c8e968b2bd6dfcd659 (patch) | |
tree | 21d06ae1087eb38d4b4df269147bea37d3e4b9a5 /sys/vm/vm_map.c | |
parent | 2ffee5db3bfb1e53bdff179aa3013972b047caec (diff) | |
download | FreeBSD-src-2f13d2c4a2e4abc8f885d9c8e968b2bd6dfcd659.zip FreeBSD-src-2f13d2c4a2e4abc8f885d9c8e968b2bd6dfcd659.tar.gz |
vm_map_insert sometimes extends an existing vm_map entry, rather than
creating a new entry. vm_map_stack and vm_map_growstack can panic when
a new entry isn't created. Fixed vm_map_stack and vm_map_growstack.
Also, when extending the stack, always set the protection to VM_PROT_ALL.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index f20a29e..dce5cb1 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_map.c,v 1.167 1999/06/17 00:27:39 alc Exp $ + * $Id: vm_map.c,v 1.168 1999/06/17 00:39:26 alc Exp $ */ /* @@ -2186,6 +2186,8 @@ vm_map_stack (vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, /* Now set the avail_ssize amount */ if (rv == KERN_SUCCESS){ + if (prev_entry != &map->header) + vm_map_clip_end(map, prev_entry, addrbos + max_ssize - init_ssize); new_stack_entry = prev_entry->next; if (new_stack_entry->end != addrbos + max_ssize || new_stack_entry->start != addrbos + max_ssize - init_ssize) @@ -2311,12 +2313,14 @@ Retry: } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - stack_entry->protection, - stack_entry->max_protection, + VM_PROT_ALL, + VM_PROT_ALL, 0); /* Adjust the available stack space by the amount we grew. */ if (rv == KERN_SUCCESS) { + if (prev_entry != &map->header) + vm_map_clip_end(map, prev_entry, addr); new_stack_entry = prev_entry->next; if (new_stack_entry->end != stack_entry->start || new_stack_entry->start != addr) |