Changeset 219273 in webkit
- Timestamp:
- Jul 7, 2017 5:03:27 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r219268 r219273 1 2017-07-07 AJ Ringer <aringer@apple.com> 2 3 Lower the max_protection for the separated heap 4 https://bugs.webkit.org/show_bug.cgi?id=174281 5 6 Reviewed by Oliver Hunt. 7 8 Switch to vm_protect so we can set maximum page protection. 9 10 * jit/ExecutableAllocator.cpp: 11 (JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps): 12 (JSC::ExecutableAllocator::allocate): 13 1 14 2017-07-07 Devin Rousso <drousso@apple.com> 2 15 -
trunk/Source/JavaScriptCore/jit/ExecutableAllocator.cpp
r219055 r219273 213 213 #if USE(EXECUTE_ONLY_JIT_WRITE_FUNCTION) 214 214 // Prevent reading the write thunk code. 215 result = mprotect(stubBase, stubSize, VM_PROT_EXECUTE_ONLY);215 result = vm_protect(mach_task_self(), reinterpret_cast<vm_address_t>(stubBase), stubSize, true, VM_PROT_EXECUTE); 216 216 RELEASE_ASSERT(!result); 217 217 #endif 218 218 219 219 // Prevent writing into the executable JIT mapping. 220 result = mprotect(jitBase, jitSize, VM_PROT_READ | VM_PROT_EXECUTE);220 result = vm_protect(mach_task_self(), reinterpret_cast<vm_address_t>(jitBase), jitSize, true, VM_PROT_READ | VM_PROT_EXECUTE); 221 221 RELEASE_ASSERT(!result); 222 222 223 223 // Prevent execution in the writable JIT mapping. 224 result = mprotect((void*)writableAddr, jitSize, VM_PROT_READ | VM_PROT_WRITE);224 result = vm_protect(mach_task_self(), static_cast<vm_address_t>(writableAddr), jitSize, true, VM_PROT_READ | VM_PROT_WRITE); 225 225 RELEASE_ASSERT(!result); 226 226 … … 397 397 dataLog("Allocating ", sizeInBytes, " bytes of executable memory with ", stats.bytesAllocated, " bytes allocated, ", stats.bytesReserved, " bytes reserved, and ", stats.bytesCommitted, " committed.\n"); 398 398 } 399 399 400 400 if (effort != JITCompilationCanFail && Options::reportMustSucceedExecutableAllocations()) { 401 401 dataLog("Allocating ", sizeInBytes, " bytes of executable memory with JITCompilationMustSucceed.\n"); 402 402 WTFReportBacktrace(); 403 403 } 404 404 405 405 if (effort == JITCompilationCanFail 406 406 && doExecutableAllocationFuzzingIfEnabled() == PretendToFailExecutableAllocation) 407 407 return nullptr; 408 408 409 409 if (effort == JITCompilationCanFail) { 410 410 // Don't allow allocations if we are down to reserve. … … 419 419 } 420 420 } 421 421 422 422 RefPtr<ExecutableMemoryHandle> result = allocator->allocate(sizeInBytes, ownerUID); 423 423 if (!result) { … … 452 452 } 453 453 #endif 454 454 455 455 } 456 456
Note: See TracChangeset
for help on using the changeset viewer.