[webkit-reviews] review requested: [Bug 174281] Lower the max_protection for the separated heap : [Attachment 314886] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 7 15:49:31 PDT 2017


Saam Barati <sbarati at apple.com> has asked  for review:
Bug 174281: Lower the max_protection for the separated heap
https://bugs.webkit.org/show_bug.cgi?id=174281

Attachment 314886: Patch

https://bugs.webkit.org/attachment.cgi?id=314886&action=review




--- Comment #3 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 314886
  --> https://bugs.webkit.org/attachment.cgi?id=314886
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.


More information about the webkit-reviews mailing list