Skip to content

Commit 9cc524e

Browse files
committed
Add entitlement assertions for JIT disabling on macOS
https://bugs.webkit.org/show_bug.cgi?id=300127 rdar://problem/161912390 Reviewed by Mark Lam. Add release assertions to verify that verified-jit and single-jit entitlements are present when disabling JIT on macOS. This ensures processes disabling JIT have the required entitlements for proper JIT region unmapping behavior. * Source/JavaScriptCore/jit/ExecutableAllocator.cpp: (JSC::ExecutableAllocator::disableJIT): Canonical link: https://commits.webkit.org/301264@main
1 parent fcde62d commit 9cc524e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎Source/JavaScriptCore/jit/ExecutableAllocator.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ void ExecutableAllocator::disableJIT()
172172
bool shouldDisableJITMemory = processHasEntitlement("com.apple.security.cs.allow-jit"_s) && !isKernOpenSource();
173173
#endif
174174
if (shouldDisableJITMemory) {
175+
#if PLATFORM(MAC)
176+
RELEASE_ASSERT(processHasEntitlement("com.apple.private.verified-jit"));
177+
RELEASE_ASSERT(processHasEntitlement("com.apple.security.cs.single-jit"));
178+
#endif
175179
// Because of an OS quirk, even after the JIT region has been unmapped,
176180
// the OS thinks that region is reserved, and as such, can cause Gigacage
177181
// allocation to fail. We work around this by initializing the Gigacage

0 commit comments

Comments
 (0)