You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Surfacing security issues with OpenBSD as part of the CI with hardened memory allocator #24669
We are analysing the PHP code and while it's clear that there are performance benefits from PHP current ZendMM allocator, we also see benefits from disabling it as a build option to surface memory corruption security bugs.
OpenBSD has a hardened memory allocator which can surface a lot of those security issues: OpenBSD malloc
Would the PHP team be willing to accept a PR for the CI which adds OpenBSD as a runner for CI builds with USE_ZEND_ALLOC=0 activated ?
USE_ZEND_ALLOC=0 can leak memory on fatal errors such as timeouts. We're considering getting rid of longjmp() completely, which would make this possible.
@loganaden We don't know yet. Some things like timeout can switch from bailout to a GracefulExit, like soft-OOM does. Other things like E_ERROR might have to switch to _exit(). There were some complications when we looked at this, like preloading depending on catchable longjmp(). _exit() can also be problematic for ZTS.
@iluuu1994 we would like to send a 1st PR to have OpenBSD 8.0 as part of the PHP CI, in addition to FreeBSD. Then, later once everybody is comfortable we can enable more mitigations on OpenBSD ?
Activity
loganaden commentedon Oct 25, 2026
@iluuu1994 there is already a FreeBSD VM: https://github.com/php/php-src/blob/master/.github/actions/freebsd/action.yml. We can build the same for OpenBSD with
USE_ZEND_ALLOC=0? we would be happy to help maintain this as part of the CI as we use OpenBSD a lot.Digi-Levy commentedon Oct 25, 2026
This is a sensible proposal. OpenBSD hardened allocator can help identify security issues early.
iluuu1994 commentedon Oct 28, 2026
USE_ZEND_ALLOC=0can leak memory on fatal errors such as timeouts. We're considering getting rid oflongjmp()completely, which would make this possible.loganaden commentedon Oct 28, 2026
@iluuu1994 how can we help with getting rid of longjmp() ?
loganaden commentedon Oct 29, 2026
@iluuu1994 is the first step deprecating use of longjmp() in different parts of the code ? Can we start with extensions ?
iluuu1994 commentedon Oct 31, 2026
@loganaden We don't know yet. Some things like timeout can switch from bailout to a
GracefulExit, like soft-OOM does. Other things likeE_ERRORmight have to switch to_exit(). There were some complications when we looked at this, like preloading depending on catchablelongjmp()._exit()can also be problematic for ZTS.loganaden commentedon Nov 14, 2026
@iluuu1994 can we send a PR for OpenBSD in the CI ?
iluuu1994 commentedon Nov 16, 2026
@loganaden Not sure what specifically you're referring to. 🙂 But sure, unless there are security implications you can send any PR.
loganaden commentedon Nov 17, 2026
@iluuu1994 we would like to send a 1st PR to have OpenBSD 8.0 as part of the PHP CI, in addition to FreeBSD. Then, later once everybody is comfortable we can enable more mitigations on OpenBSD ?