mac-arm64: Use MAP_JIT for code not signed to use the hardened runtime
In a change from x86_64, macOS on arm64 requires MAP_JIT for code not using the hardened runtime. However, if MAP_JIT is specified for signed code lacking the JIT entitlement, mmap and mprotect fail with EINVAL, so it’s still not possible to use MAP_JIT everywhere it could conceivably be required. A wasm attempt to mprotect a region as PROT_READ | PROT_WRITE | PROT_EXEC was succeeding in signed builds but failing in non-hardened-runtime processes with EPERM as a result of the mapping lacking MAP_JIT. In a previous (post-facto drive-by) review of this code (https://chromium-review.googlesource.com/c/2078792), I noted “I would have preferred the caller coming in with affirmative knowledge of whether it wanted JIT or not” but the callers aren’t necessarily aware of the entitlement regime they’re expected to run under. Bug: 1144200 Change-Id: I2edde64922dfbd8ba7158cc741b0e82d680235b8 CQ-Include-Trybots: luci.chromium.try:mac-arm64-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523446Reviewed-by:Robert Sesek <rsesek@chromium.org> Reviewed-by:
Nico Weber <thakis@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org> Cr-Commit-Position: refs/heads/master@{#825684}
Showing
Please register or sign in to comment