Date: Wed, 19 Jul 2017 19:00:33 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321230 - head/sys/vm Message-ID: <201707191900.v6JJ0X87083420@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Jul 19 19:00:32 2017 New Revision: 321230 URL: https://svnweb.freebsd.org/changeset/base/321230 Log: Disable stack growth when accessed by AIO daemons. Commit message for r321173 incorrectly stated that the change disables automatic stack growth from the AIO daemons contexts, with explanation that this is currently prevents applying wrong resource limits. Fix this by actually disabling the growth. Noted by: alc Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Jul 19 18:59:26 2017 (r321229) +++ head/sys/vm/vm_map.c Wed Jul 19 19:00:32 2017 (r321230) @@ -3698,8 +3698,15 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma p = curproc; vm = p->p_vmspace; - if (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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707191900.v6JJ0X87083420>