From 8c40f3212b62b828f3cfbe151fb3ecd2294e44ca Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Wed, 24 Aug 2011 03:33:36 +0000 Subject: Give plug-in processes an executable heap and disable PIE/ASLR for Native Client loader processes. Some plug-ins depend on having an executable heap. They write code to data pages and attempt to execute it without calling mprotect to mark this code as executable. Native Client needs to allocate a contiguous 1GB of address space. ASLR may interfere with there being a "hole" this large in the address space by the time NaCl makes its request. Non-executable heaps are only available in 10.7 and later for 32-bit processes. PIE/ASLR was formerly disabled for all processes other than the browser process. This change reenables it for all processes other than the NaCl loader. PIE/ASLR is available on 10.5 and later, although the implementation is stronger in 10.7 than in earlier releases. This change results in two new helpers in addition to the existing Chromium Helper.app: Chromium Helper EH.app (for executable heaps) and Chromium Helper NP.app (for no PIE). libplugin_carbon_interpose.dylib moves out of the helper .app and directly into the versioned directory. The InfoPlist.strings have been removed from the helper app, but empty .lproj directories remain. BUG=90221, 93551 TEST=everything Review URL: http://codereview.chromium.org/7714018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97984 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/worker_host/worker_process_host.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'content/browser/worker_host') diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index f51aed6..6e47140 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -118,7 +118,13 @@ bool WorkerProcessHost::Init(int render_process_id) { if (!CreateChannel()) return false; - FilePath exe_path = GetChildPath(true); +#if defined(OS_LINUX) + int flags = CHILD_ALLOW_SELF; +#else + int flags = CHILD_NORMAL; +#endif + + FilePath exe_path = GetChildPath(flags); if (exe_path.empty()) return false; -- cgit v1.1