diff options
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index c9815c0..3a83252 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -3700,7 +3700,15 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map_entry_t gap_entry) p = curproc; vm = p->p_vmspace; - MPASS(map == &p->p_vmspace->vm_map); + + /* + * Disallow stack growth when the access is performed by a + * debugger or AIO daemon. The reason is that the wrong + * resource limits are applied. + */ + if (map != &p->p_vmspace->vm_map || p->p_textvp == NULL) + return (KERN_FAILURE); + MPASS(!map->system_map); guard = stack_guard_page * PAGE_SIZE; |