Force PHP binaries to link with non PIC objects on x86_64#1650
Force PHP binaries to link with non PIC objects on x86_64#1650bogdanandone wants to merge 4 commits intophp:masterfrom
Conversation
There was a problem hiding this comment.
the line forces libtool to compile both static and dynamic objects if sapi binaries are in the target;
without this line libtool compiles only PIC objects
|
Was this tested with --enable-dtrace? |
|
I suppose no. On Thu, Nov 26, 2015 at 12:46 AM, Christopher Jones <
|
|
I did a build with --enable-dtrace configuration flag. I can confirm the followings:
Unfortunately I am unable to have a real dtrace run as I don't have an Oracle Linux platform. |
|
Dtrace is available on OS X too, if that helps. |
|
Why do you think, non-PIC build will prevent dtrace from work?
|
|
OS X platform not available... |
|
doesn't "--with-pic Try to use only PIC/non-PIC objects default=use both" work? |
|
It looks like libtool compiles each C file teice (with -fPIC and without), On Mon, Nov 30, 2015 at 9:13 AM, Xinchen Hui notifications@github.com
|
Cleaner than forcing 'php_sapi_module' as it simple preserves enable_static=yes default value.
|
Notice: some linux distro requires to use PIC object for security reason. |
|
then maybe we should make this can be controlled by configure option like --(en|dis)able-pic? |
|
Thanks for the info, Remi. Ping @oerdnj, what are the Debian policies on enforcing PIC? @bogdanandone were you keen to study yet more the security implications? In Windows builds, /DYNAMICBASE is enabled always and cannot be disabled. IMHO this PR should be reevaluated from the security angle. The suggestion of @laruence to have a switch, probably that is disabled by default, could be an option. Thanks. |
|
Actually I was wondering why is PHP systematically using PIC objects everywhere ... Thanks to Remi now I have an answer :-) . From your notes I understand that the capability to relocate binaries for security reasons should be preferred by default before performance. I will look how --with-pic flag could be used. For now they have a strange behavior on my configuration so I have to go in a deeper investigation. Thanks. |
|
Not entirely sure that Debian has PIC as a system-wide policy, since Debian Hardening is still not release goal. But we definitely want have ASLR as much as possible for the code exposed to the wild wild internet. I think this would cause a lot of frowning in our security team and I would most probably revert this patch for Debian builds to have a PIC (and possibly PIE) build. |
No description provided.