All 32-bit plug-ins should use the XPC service
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 18:57:05 +0000 (18:57 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 18:57:05 +0000 (18:57 +0000)
commitd4a56839bfaef69f3bc3e8790cc13c4fc4e88fc7
tree132262b232a59bd0221dc01dcb9dc14baa7803c0
parent8a73600dd4d2adf2110b9c61521b564893bb786b
All 32-bit plug-ins should use the XPC service
https://bugs.webkit.org/show_bug.cgi?id=154036
rdar://problem/16059483

Reviewed by Dan Bernstein.

Silverlight expects malloced memory from the tiny zone to be executable. It also expects
the data segment from its coreclr image to be executable.

Make this possible by:

1. Shimming mach_vm_map, making sure to add the VM_PROT_EXECUTABLE bit to any memory in the tiny zone.
2. Go through the address space, looking for any existing ranges from the tiny zone and mach_vm_protect them
   to be executable.
3. Register with dyld so we'll get callbacks whenever a library is bound, look for the coreclr image, and
   mach_vm_protect its __DATA segment to be executable.

* Platform/spi/Cocoa/DyldSPI.h: Copied from Source/WebKit2/PluginProcess/mac/PluginProcessShim.h.
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::isMallocMemoryTag):
(WebKit::shouldMapMemoryExecutable):
(WebKit::initializeShim):
(WebKit::PluginProcess::platformInitializeProcess):
* PluginProcess/mac/PluginProcessShim.h:
* PluginProcess/mac/PluginProcessShim.mm:
(WebKit::shimMachVMMap):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptions):
(WebKit::shouldUseXPC): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/spi/Cocoa/DyldSPI.h [new file with mode: 0644]
Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
Source/WebKit2/PluginProcess/mac/PluginProcessShim.h
Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm
Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj