3 ms·
Would you need executable and writable at the same time? The JIT generates code into a writable+non-executable memory, and then makes it readonly+executable.
by xtacy 15y ago
Would you need executable and writable at the same time? The JIT generates code into a writable+non-executable memory, and then makes it readonly+executable.
- pilif 15y agoThat's the point. You don't get segments that you can mark as executable if you are a third-party app. The only code that's executable is the code segment of the compiled binary (that's signed by apple and won't be executed if it has changed since it has been signed). Trying to mark memory as executable will cause your app to be terminated. Jumping into non-executable memory will also cause your app to be terminated. Aside of protecting you (as a user or as a developer) from a big class of security issues, this also ensures that nobody ever gets to run code that's not loaded from the App Store (and thus would generate revenue without giving a share to Apple).