Summary: | Lower the max_protection for the separated heap | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | AJ Ringer <aringer> | ||||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | buildbot, commit-queue, keith_miller, mark.lam, msaboff, oliver, saam, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
AJ Ringer
2017-07-07 15:45:22 PDT
Created attachment 314886 [details]
Patch
Comment on attachment 314886 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=314886&action=review > Source/JavaScriptCore/jit/ExecutableAllocator.cpp:224 > + result = vm_protect(mach_task_self(), (vm_address_t)stubBase, stubSize, true, VM_PROT_EXECUTE); > RELEASE_ASSERT(!result); > #endif > > // Prevent writing into the executable JIT mapping. > - result = mprotect(jitBase, jitSize, VM_PROT_READ | VM_PROT_EXECUTE); > + result = vm_protect(mach_task_self(), (vm_address_t)jitBase, jitSize, true, VM_PROT_READ | VM_PROT_EXECUTE); > RELEASE_ASSERT(!result); > > // Prevent execution in the writable JIT mapping. > - result = mprotect((void*)writableAddr, jitSize, VM_PROT_READ | VM_PROT_WRITE); > + result = vm_protect(mach_task_self(), (vm_address_t)writableAddr, jitSize, true, VM_PROT_READ | VM_PROT_WRITE); Style nit: Please use static_cast instead of C-style casts. Oops, didn't mean to clear r+ (In reply to Saam Barati from comment #3) > Comment on attachment 314886 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=314886&action=review > > > Source/JavaScriptCore/jit/ExecutableAllocator.cpp:224 > > + result = vm_protect(mach_task_self(), (vm_address_t)stubBase, stubSize, true, VM_PROT_EXECUTE); > > RELEASE_ASSERT(!result); > > #endif > > > > // Prevent writing into the executable JIT mapping. > > - result = mprotect(jitBase, jitSize, VM_PROT_READ | VM_PROT_EXECUTE); > > + result = vm_protect(mach_task_self(), (vm_address_t)jitBase, jitSize, true, VM_PROT_READ | VM_PROT_EXECUTE); > > RELEASE_ASSERT(!result); > > > > // Prevent execution in the writable JIT mapping. > > - result = mprotect((void*)writableAddr, jitSize, VM_PROT_READ | VM_PROT_WRITE); > > + result = vm_protect(mach_task_self(), (vm_address_t)writableAddr, jitSize, true, VM_PROT_READ | VM_PROT_WRITE); > > Style nit: Please use static_cast instead of C-style casts. for void*? I think it might need to be reinterpret_cast<> because vmprotect is obnoxious and uses uint66 or some such nonsense Comment on attachment 314886 [details]
Patch
AJ is posting an updated patch
Created attachment 314892 [details]
Patch
Comment on attachment 314892 [details] Patch Clearing flags on attachment: 314892 Committed r219273: <http://trac.webkit.org/changeset/219273> All reviewed patches have been landed. Closing bug. |