Skip to content

Surfacing security issues with OpenBSD as part of the CI with hardened memory allocator #24669

Open

Description

@loganaden

Description

Hi folks,

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 ?

Activity

  1. loganaden commented on Oct 25, 2026

    @loganaden
    Author

    @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.

  2. Digi-Levy commented on Oct 25, 2026

    @Digi-Levy

    This is a sensible proposal. OpenBSD hardened allocator can help identify security issues early.

  3. iluuu1994 commented on Oct 28, 2026

    @iluuu1994
    Member

    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.

  4. loganaden commented on Oct 28, 2026

    @loganaden
    Author

    @iluuu1994 how can we help with getting rid of longjmp() ?

  5. loganaden commented on Oct 29, 2026

    @loganaden
    Author

    @iluuu1994 is the first step deprecating use of longjmp() in different parts of the code ? Can we start with extensions ?

  6. iluuu1994 commented on Oct 31, 2026

    @iluuu1994
    Member

    @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.

  7. loganaden commented on Nov 14, 2026

    @loganaden
    Author

    @iluuu1994 can we send a PR for OpenBSD in the CI ?

  8. iluuu1994 commented on Nov 16, 2026

    @iluuu1994
    Member

    @loganaden Not sure what specifically you're referring to. 🙂 But sure, unless there are security implications you can send any PR.

  9. loganaden commented on Nov 17, 2026

    @loganaden
    Author

    @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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions