4 ms·
even to the syscall level, like the MAP_JIT flag to mmap() https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-ji
by wscott 6y ago
even to the syscall level, like the MAP_JIT flag to mmap()
https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit https://developer.apple.com/documentation/bundleresources/en...
not optional and requires special app entitlements to enable. So you are not going to write portable code that has a JIT without apple-special code.
- TwoBit 6y agoA JIT is a major potential source of malware enablement and thus a security consideration.
- andrekandre 6y agoapplogies if its an ignorant question but, if the os had proper access protections, even with a buffer overflow or other exploits to an app itself, how can that enable malware just by having a JIT?
- saagarjha 6y agoIt cannot; Apple's security policy towards third-party JITs is misguided. Such a feature is useful if you are interested in providing defense-in-depth for a JIT that you have taken effort to secure and would like stronger, hardware-backed mitigations for. The API should really be opt-in for the apps that want it–the real consumers of it are going to Chrome and Firefox.
- lmm 6y agoJIT requires bypassing exploit mitigations e.g. W^X. JIT doesn't make an app that's already been subverted any more dangerous than it would otherwise be, but it makes it easier to exploit the app in the first place.
- saagarjha 6y agoAnd that JIT has additional considerations on Apple silicon, where there is specific hardware that needs to be taken into account: https://developer.apple.com/documentation/apple_silicon/porting_just-in-time_compilers_to_apple_silicon https://developer.apple.com/documentation/apple_silicon/port...
- Klonoar 6y agoI ran into another quirk with MAP_JIT recently, but going the other direction in time. If you supported an older platform (High Sierra, which up until recently was... valid...), you would need to explicitly _not_ pass MAP_JIT into mmap there. It makes total sense once you find the bug, but it was also an easy one to overlook. Tracking that down was kind of annoying.