Commit ccbb472
committed
On Majave and later, allocate with MAP_JIT
The VM requires writeable + executable memory which is blocked when
the "hardened runtime" is enabled at the codesigning stage.
If we pass the `MAP_JIT` flag then we can add the capability
com.apple.security.cs.allow-jit [1]
to permit the allocation. The alternative is to globally enable
write+execute for all allocations in the process which seems worse [2]
[1] https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit
[2] https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-unsigned-executable-memory
Signed-off-by: David Scott <[email protected]>1 parent 04f7bc8 commit ccbb472
1 file changed
+42
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
37 | 74 | | |
38 | 75 | | |
39 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
40 | 81 | | |
41 | 82 | | |
42 | 83 | | |
| |||
46 | 87 | | |
47 | 88 | | |
48 | 89 | | |
49 | | - | |
| 90 | + | |
50 | 91 | | |
51 | 92 | | |
52 | 93 | | |
| |||
0 commit comments