[Bug 295991] lib/libc posix_spawnp(): PATH-search child runs on an undersized rfork_thread stack and underflows into the caller's heap (heavily-linked processes; PHP proc_open)
Date: Fri, 26 Jun 2026 16:11:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295991
Kyle Evans <kevans@freebsd.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kevans@freebsd.org,
| |kib@FreeBSD.org
--- Comment #3 from Kyle Evans <kevans@freebsd.org> ---
I'm tempted to switch the posix_spawn stack size to `DFLSSIZ` or kern.dflssiz,
depending on how fancy we want to be:
```
amd64/include/vmparam.h:65:#define DFLSSIZ (8UL*1024*1024)
/* initial stack size limit */
arm/include/vmparam.h:54:#define DFLSSIZ (4UL*1024*1024)
/* initial stack size limit */
arm64/include/vmparam.h:56:#define DFLSSIZ (128*1024*1024)
/* initial stack size limit */
i386/include/vmparam.h:55:#define DFLSSIZ (8UL*1024*1024)
/* initial stack size limit */
powerpc/include/vmparam.h:62:#define DFLSSIZ (8*1024*1024)
/* default stack size */
riscv/include/vmparam.h:52:#define DFLSSIZ (128*1024*1024)
/* initial stack size limit */
```
128M on arm64 is maybe a little excessive? Better safe than sorry, though. CC
kib@ in case he has a better opinion.
--
You are receiving this mail because:
You are the assignee for the bug.