Bug #72281 [NEW]: PaX MPROTECT breaks php
| From: | tk at giga dot or dot at | Date: | Sat, 28 May 2016 08:11:54 +0000 |
| Subject: | Bug #72281 [NEW]: PaX MPROTECT breaks php | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-201306@lists.php.net to get a copy of this message | ||
From: tk at giga dot or dot at
Operating system: NetBSD
PHP version: 7.0.7
Package: Compile Failure
Bug Type: Bug
Bug description:PaX MPROTECT breaks php
Description:
------------
When compiling php-7.0.7 on NetBSD-7.99.29/amd64, the compilation fails
because php dumps core.
The problem is that NetBSD on that release has PaX MPROTECT turned on by
default (see
http://netbsd.gw.com/cgi-bin/man-cgi?security++NetBSD-current),
i.e. it
does not allow mapping pages both writable and executable. However, this
is needed by php.
The backtrace of the core dump has:
#1 0x00000000004d0d87 in _pcre_jit_exec ()
#2 0x00000000004a53f1 in php_pcre_exec ()
Since JIT and MPROTECT are at odds with each other, I suggest running
"paxctl +m" on the binary, which (on NetBSD, see
http://netbsd.gw.com/cgi-bin/man-cgi?paxctl++NetBSD-current)
removes the
MPROTECT restrictions for the php binary.
A workaround patch is attached.
It can not be used as is, since paxctl on *BSD and paxctl on Linux have
different syntax.
I hope that someone can extend this to also work on Linux.
The patch is an example, but is tested and works on NetBSD.
--
Edit bug report at https://bugs.php.net/bug.php?id=72281&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72281&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72281&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72281&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72281&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72281&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72281&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72281&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72281&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72281&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72281&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72281&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72281&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72281&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72281&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72281&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72281&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72281&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72281&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72281&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72281&r=mysqlcfg