Re: Issue with php81-extensions and aslr FreeBSD

From: Wojciech Macek <wma_at_semihalf.com>
Date: Wed, 15 Jun 2022 07:28:33 UTC
Hi,

I confirm that it happens on my setup as well.
Have you tried to build official PHP-8.1.6 instead using the one from
ports? It seems it works.

I tried with

freebsd:~/php-src # git status
HEAD detached at origin/PHP-8.1.6
nothing to commit, working tree clean
freebsd:~/php-src #
freebsd:~/php-src # ./buildconf
freebsd:~/php-src # ./configure --without-iconv --enable-shared --with-apxs2
freebsd:~/php-src # make -j4
freebsd:~/php-src # make install


Regards,
Wojtek


>>>>>

Running 13.1-RELEASE with everything installed from packages and aslr
enabled, apache24 will core dump on a graceful restart after installing
php81-extensions.

Start with apache24, php81 and mod_php81 installed
/usr/local/etc/rc.d/apache24 start
apache is running
/usr/local/etc/rc.d/apache24 graceful
apache is still running

Then install php81-extensions:

/usr/local/etc/rc.d/apache24 stop
pkg install php81-extensions
/usr/local/etc/rc.d/apache24 start
apache is running
/usr/local/etc/rc.d/apache24 graceful
kernel: pid 2122 (httpd), jid 0, uid 0: exited on signal 11 (core dumped)

This is with using all the default conf files.  If I disable aslr it works
fine.  I'm enabling aslr by adding these lines to /etc/sysctl.conf and
rebooting.

kern.elf32.aslr.enable=1
kern.elf32.aslr.pie_enable=1
kern.elf32.aslr.honor_sbrk=0
kern.elf64.aslr.enable=1
kern.elf64.aslr.pie_enable=1
kern.elf64.aslr.honor_sbrk=0

This is the first time I've tried enabling aslr so maybe I'm doing something
wrong.