Commit c70f5161 authored by Mark Mentovai's avatar Mark Mentovai

mac: Fix logic error in dec31e17

dec31e17 (https://chromium-review.googlesource.com/c/2523446) was
supposed to make memory allocations use MAP_JIT on macOS ≥ 10.14
whenever the hardened runtime wasn’t active, but a serious goof inverted
the logic, causing MAP_JIT to be used whenever the hardened runtime was
active. This is only feasible for processes that have the JIT
entitlement, and not all do. Attempts to allocate memory in this way in
affected processes would fail, which would appear as an out-of-memory
condition, which isn’t quite accurate, but it’s definitely a memory
allocation problem.

Bug: 1144200, 1147831
Change-Id: I9c8f925ec7b311b2d655dd3a5f367fd01e80d7e2
CQ-Include-Trybots: luci.chromium.try:mac-arm64-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532728
Auto-Submit: Mark Mentovai <mark@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826497}
parent 4e87d75a
...@@ -113,7 +113,7 @@ bool UseMapJit() { ...@@ -113,7 +113,7 @@ bool UseMapJit() {
} }
uint32_t flags = SecTaskGetCodeSignStatus(task); uint32_t flags = SecTaskGetCodeSignStatus(task);
if ((flags & kSecCodeSignatureRuntime) != 0) { if (!(flags & kSecCodeSignatureRuntime)) {
// The hardened runtime is not enabled. Note that kSecCodeSignatureRuntime // The hardened runtime is not enabled. Note that kSecCodeSignatureRuntime
// == CS_RUNTIME. // == CS_RUNTIME.
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment