[TIMOB-8336] iOS: Feature request to enable fPIE command line option in iOS app build
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-07-11T09:22:05.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | SupportTeam, core |
Reporter | Varun Joshi |
Assignee | Stephen Tramer |
Created | 2012-03-27T14:41:03.000+0000 |
Updated | 2017-03-23T21:40:06.000+0000 |
Description
A new feature has been requested to be added to the iOS app binary, that improves the code security. It utilizes the ASLR (address space layout randomization) that Apple has introduced as an important security feature in the latest version of the iPhone's software (4.3+).
The PIE can be enabled when compiling by command line with option -fPIE. Essentially, we need to be able to compile with the command line option -fPIE.
This article explains more about the address space randomization and how iPhone utilizes it: http://money.cnn.com/2011/08/04/technology/iphone_hack/index.htm
All applications compiled for iOS 4.3+ have -fPIE option on by default. The reason that the resulting binary is not PIE (and thus partially utilizes ASLR) is that all object files should be compiled with PIC (Position Independent Code) option. This includes any external static libraries, JSCore runtime, modules etc. If any of the object files is not PIC, the whole application binary will not be PIE.
How to detect if an application binary compiled as PIE:
This ticket can be resolved by taking advantage of the new
<min-ios-ver>
setting intiapp.xml
by bumping it to 4.3 or higher. Only these versions of iOS support PIC/PIE. If running with various internal modules continues to keep executables produced by Titanium at PIE for versions 4.3+, will resolve as INVALID.It is also worth noting that armv6 does not appear to support PIE. Only armv7 devices will support it.
Not necessary. All libraries and Titanium apps compile as PIC but the minimum iOS version must be set to at least 4.3. Use the feature described in TIMOB-2999 which is available in 2.2.0 CI as of now.
Closing ticket as invalid with reference to the previous comments.