summaryrefslogtreecommitdiffstats
path: root/chrome/nacl/nacl_fork_delegate_linux.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move ZygoteForkDelegateLinux to content/public/common.jam@chromium.org2011-10-251-151/+0
| | | | | | | BUG=98716 Review URL: http://codereview.chromium.org/8381029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107128 0039d316-1c4b-4281-b951-d872f2087c98
* Add UMA reports for Linux nacl_helper startup statusmcgrathr@chromium.org2011-10-201-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | This extends the Linux Zygote Fork request protocol so the Zygote process can return a UMA histogram enumeration report to be made, along with the PID. In the Zygote process, the ZygoteForkDelegate decides what to report. It gets to choose an initial report to make, which happens on the first fork request that doesn't have its own report to make (as a generic fork for a renderer won't). It also gets to choose a report to make with each individual fork request. We then use this in the NaClForkDelegate to report status about the attempt to start up the nacl_helper process. We both make an initial report, so we can collect this information from every Chrome instance, and make a report repeating the same information on each NaCl process fork request, so that we can correlate the nacl_helper startup success/failure rates with sessions that actually make use of NaCl. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2361 TEST= looked at about:histograms/NaCl R=agl@chromium.org,bradchen@google.com,ncbray@google.com Review URL: http://codereview.chromium.org/8342017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106529 0039d316-1c4b-4281-b951-d872f2087c98
* Modify the build recipe for nacl_helper_bootstrap to invoke the linker ↵bradchen@google.com2011-09-071-1/+0
| | | | | | | | | | | | | | | explicitly via an action rather than invoking via g++. This addresses build problems that occurred on certain developer machines. Also, modified tools/ld_bfd/ld script to find the loader within the Chrome OS build chroot. Also re-enable the nacl_helper. BUG=92964,nativeclient:480 TEST=nacl_integration tests on bots Review URL: http://codereview.chromium.org/7841008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100031 0039d316-1c4b-4281-b951-d872f2087c98
* Revert nacl_helper while working out developer build issuesbradchen@google.com2011-09-061-0/+1
| | | | | | | | | | | | | Identical change previously reviewed as 7789006, couldn't commit due to git issues. TBR=jam@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/7839007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99789 0039d316-1c4b-4281-b951-d872f2087c98
* Fix nacl_helper argv bug, re-enable nacl_helper, build on linux except ARM. ↵bradchen@google.com2011-09-051-7/+4
| | | | | | | | | | | | | Previously reviewed as http://codereview.chromium.org/7833017; this time ARM build is disabled. TBR=mcgrathr,mseaborn,evanm BUG=92964,nativeclient:480,95196 TEST=nacl_integration on linux Review URL: http://codereview.chromium.org/7800026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99622 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 99617 - Fix nacl_helper startup bug with command line construction.hbono@chromium.org2011-09-051-4/+7
| | | | | | | | | | | | | | | | | | | Add proper chrome dependencies. Re-enable nacl_helper. BUG=92964,nativeclient:480,95168 TEST=nacl_integration tests on bots Review URL: http://codereview.chromium.org/7833017 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7779029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99619 0039d316-1c4b-4281-b951-d872f2087c98
* Fix nacl_helper startup bug with command line construction.bradchen@google.com2011-09-051-7/+4
| | | | | | | | | | | | | | | | Add proper chrome dependencies. Re-enable nacl_helper. BUG=92964,nativeclient:480,95168 TEST=nacl_integration tests on bots Review URL: http://codereview.chromium.org/7833017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99617 0039d316-1c4b-4281-b951-d872f2087c98
* Disable nacl_helper while fixing DCHECK issue.bradchen@google.com2011-09-021-0/+2
| | | | | | | | | | | TBR=mcgrathr BUG= TEST= Review URL: http://codereview.chromium.org/7831046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99410 0039d316-1c4b-4281-b951-d872f2087c98
* Don't use NaCl helper when run under Valgrindtimurrrr@chromium.org2011-09-021-1/+3
| | | | | | | | | TBR=bradchen,eugenis TEST=Valgrind bots go greener BUG=95171 Review URL: http://codereview.chromium.org/7792096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99345 0039d316-1c4b-4281-b951-d872f2087c98
* Enable nacl_helper by default.bradchen@google.com2011-09-021-6/+1
| | | | | | | | | | BUG=92964,nativeclient:480 TEST=nacl_integration in chromium bots Review URL: http://codereview.chromium.org/7821021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99319 0039d316-1c4b-4281-b951-d872f2087c98
* Use chain-loading for Linux nacl_helpermcgrathr@chromium.org2011-09-011-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the nacl_helper_bootstrap program, dynamically-linked against nacl_helper.so, with a standalone, statically-linked nacl_helper_bootstrap program that loads the dynamic linker, instructing it in turn to load the nacl_helper program (now a PIE rather than a DSO). This avoids two problems with the old scheme: 1. The nacl_helper_bootstrap program remained in the dynamic linker's list of loaded objects, as the main executable, even though the memory where its .dynamic section had been was overwritten with the NaCl untrusted address space. Code that traverses the list of all loaded objects could thus attempt to look at pointers into this part of memory, and be led astray. 2. nacl_helper_bootstrap's large (~1G) bss segment could cause the kernel to refuse to load the program because it didn't think there was enough free memory in the system for so large an allocation of anonymous memory. The bootstrap program is kept very small by avoiding all use of libc (except for memset and integer division routines needed on ARM). It has its own custom start-up code hand-written in assembly and its own custom system call stubs done with hand-written GCC inline asm statements. To avoid the second problem, the bootstrap program no longer has a large bss. Instead, it has a special ELF segment (i.e. PT_LOAD header) that specifies no memory access, and a large (~1G) mapping size from the file. This mapping is way off the end of the file, but the kernel doesn't mind that, and since it's all a file mapping, the kernel does not do its normal memory accounting for consuming a large amount of anonymous memory. Unfortunately, it's impossible to get the linker to produce exactly the right PT_LOAD header by itself. Using a custom linker script, we get the layout exactly how we want it and a PT_LOAD header that is almost right. We then use a build-time helper program to munge one field of the PT_LOAD to make it exactly what we need. BUG= http://code.google.com/p/chromium/issues/detail?id=94147 TEST= hand-tested chromium build R=bradchen@google.com Review URL: http://codereview.chromium.org/7776034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99089 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 98909 - Use chain-loading for Linux nacl_helperjar@chromium.org2011-08-311-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the nacl_helper_bootstrap program, dynamically-linked against nacl_helper.so, with a standalone, statically-linked nacl_helper_bootstrap program that loads the dynamic linker, instructing it in turn to load the nacl_helper program (now a PIE rather than a DSO). This avoids two problems with the old scheme: 1. The nacl_helper_bootstrap program remained in the dynamic linker's list of loaded objects, as the main executable, even though the memory where its .dynamic section had been was overwritten with the NaCl untrusted address space. Code that traverses the list of all loaded objects could thus attempt to look at pointers into this part of memory, and be led astray. 2. nacl_helper_bootstrap's large (~1G) bss segment could cause the kernel to refuse to load the program because it didn't think there was enough free memory in the system for so large an allocation of anonymous memory. The bootstrap program is kept very small by avoiding all use of libc (except for memset and integer division routines needed on ARM). It has its own custom start-up code hand-written in assembly and its own custom system call stubs done with hand-written GCC inline asm statements. To avoid the second problem, the bootstrap program no longer has a large bss. Instead, it has a special ELF segment (i.e. PT_LOAD header) that specifies no memory access, and a large (~1G) mapping size from the file. This mapping is way off the end of the file, but the kernel doesn't mind that, and since it's all a file mapping, the kernel does not do its normal memory accounting for consuming a large amount of anonymous memory. Unfortunately, it's impossible to get the linker to produce exactly the right PT_LOAD header by itself. Using a custom linker script, we get the layout exactly how we want it and a PT_LOAD header that is almost right. We then use a build-time helper program to munge one field of the PT_LOAD to make it exactly what we need. BUG= http://code.google.com/p/chromium/issues/detail?id=94147 TEST= hand-tested chromium build, invoked with --nacl-linux-helper R=bradchen@google.com,mseaborn@chromium.org Review URL: http://codereview.chromium.org/7795010 TBR=mcgrathr@chromium.org Review URL: http://codereview.chromium.org/7811013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98910 0039d316-1c4b-4281-b951-d872f2087c98
* Use chain-loading for Linux nacl_helpermcgrathr@chromium.org2011-08-311-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the nacl_helper_bootstrap program, dynamically-linked against nacl_helper.so, with a standalone, statically-linked nacl_helper_bootstrap program that loads the dynamic linker, instructing it in turn to load the nacl_helper program (now a PIE rather than a DSO). This avoids two problems with the old scheme: 1. The nacl_helper_bootstrap program remained in the dynamic linker's list of loaded objects, as the main executable, even though the memory where its .dynamic section had been was overwritten with the NaCl untrusted address space. Code that traverses the list of all loaded objects could thus attempt to look at pointers into this part of memory, and be led astray. 2. nacl_helper_bootstrap's large (~1G) bss segment could cause the kernel to refuse to load the program because it didn't think there was enough free memory in the system for so large an allocation of anonymous memory. The bootstrap program is kept very small by avoiding all use of libc (except for memset and integer division routines needed on ARM). It has its own custom start-up code hand-written in assembly and its own custom system call stubs done with hand-written GCC inline asm statements. To avoid the second problem, the bootstrap program no longer has a large bss. Instead, it has a special ELF segment (i.e. PT_LOAD header) that specifies no memory access, and a large (~1G) mapping size from the file. This mapping is way off the end of the file, but the kernel doesn't mind that, and since it's all a file mapping, the kernel does not do its normal memory accounting for consuming a large amount of anonymous memory. Unfortunately, it's impossible to get the linker to produce exactly the right PT_LOAD header by itself. Using a custom linker script, we get the layout exactly how we want it and a PT_LOAD header that is almost right. We then use a build-time helper program to munge one field of the PT_LOAD to make it exactly what we need. BUG= http://code.google.com/p/chromium/issues/detail?id=94147 TEST= hand-tested chromium build, invoked with --nacl-linux-helper R=bradchen@google.com,mseaborn@chromium.org Review URL: http://codereview.chromium.org/7795010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98909 0039d316-1c4b-4281-b951-d872f2087c98
* Reserve 1GB at the base of the address space of linux nacl_helper for Native ↵bradchen@google.com2011-08-171-7/+15
| | | | | | | | | | | | | | | | | | | Client module. Use PathService instead of command line flag to enable helper. Adds a nacl_helper_bootstrap executable that implements the actual space reservation. This is for resubmit of reverted CL 7670011, fixing nacl.gypi for the linux_shared build. See 7670011 and 7599011 for review history. TBR=agl,bradnelson BUG=92964, nativeclient:480 TEST=manual for now Review URL: http://codereview.chromium.org/7655010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97137 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 97056 - Gyp fix for release build.rvargas@google.com2011-08-161-15/+7
| | | | | | | | | | | | | | | | | | Reserve 1GB at the base of the address space of linux nacl_helper for Native Client module. Use PathService instead of command line flag to enable helper. Adds a nacl_helper_bootstrap executable that implements the actual space reservation. See http://codereview.chromium.org/7599011 for extended revision history. This is a gyp fix following a revert. TBR=agl,bradnelson BUG=92964, nativeclient:480 TEST=manual for now Review URL: http://codereview.chromium.org/7670011 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7671011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97058 0039d316-1c4b-4281-b951-d872f2087c98
* Gyp fix for release build.bradchen@google.com2011-08-161-7/+15
| | | | | | | | | | | | | | | Reserve 1GB at the base of the address space of linux nacl_helper for Native Client module. Use PathService instead of command line flag to enable helper. Adds a nacl_helper_bootstrap executable that implements the actual space reservation. See http://codereview.chromium.org/7599011 for extended revision history. This is a gyp fix following a revert. TBR=agl,bradnelson BUG=92964, nativeclient:480 TEST=manual for now Review URL: http://codereview.chromium.org/7670011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97056 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 97040 - Reserve 1GB at the base address of linux nacl_helper for ↵rvargas@google.com2011-08-161-15/+7
| | | | | | | | | | | | | | | | Native Client. Use PathService instead of command line flag to obtain path for helper. Adds a nacl_helper_bootstrap executable that implements the actual space reservation. BUG=nativeclient:480 TEST=manual for now Review URL: http://codereview.chromium.org/7599011 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7669004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97042 0039d316-1c4b-4281-b951-d872f2087c98
* Reserve 1GB at the base address of linux nacl_helper for Native Client.bradchen@google.com2011-08-161-7/+15
| | | | | | | | | | | Use PathService instead of command line flag to obtain path for helper. Adds a nacl_helper_bootstrap executable that implements the actual space reservation. BUG=nativeclient:480 TEST=manual for now Review URL: http://codereview.chromium.org/7599011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97040 0039d316-1c4b-4281-b951-d872f2087c98
* Fix error handling on close() calls.bradchen@google.com2011-07-221-4/+6
| | | | | | | | | | BUG=89914 TEST=clean error logs Review URL: http://codereview.chromium.org/7483015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93566 0039d316-1c4b-4281-b951-d872f2087c98
* A ZygoteForkDelegate using nacl_helper executable to create container ↵bradchen@google.com2011-07-201-0/+119
| | | | | | | | | | | processes for NaCl modules. BUG=nativeclient:480 TEST=NaCl tests in Chrome Review URL: http://codereview.chromium.org/7442001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93195 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 93021 - A ZygoteForkDelegate for Native Client.robertshield@chromium.org2011-07-191-115/+0
| | | | | | | | | | | | BUG=nativeclient:480 TEST=native client chrome linux tests Review URL: http://codereview.chromium.org/7395024 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7440001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93023 0039d316-1c4b-4281-b951-d872f2087c98
* A ZygoteForkDelegate for Native Client.bradchen@google.com2011-07-191-0/+115
| | | | | | | | | BUG=nativeclient:480 TEST=native client chrome linux tests Review URL: http://codereview.chromium.org/7395024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93021 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 90805 - I am submitting this with LGTMs from agl@ and evanm@. I'm ↵fischman@chromium.org2011-06-281-119/+0
| | | | | | | | | | | | | | | | | | | | | | | marking this as TBR=jam@ because he is on vacation. He previously LGTMed the reverted CL (link below) and there are not substantive changes since then. Modify the Chrome Linux zygote to support a nacl_helper executable, facilitating a special address-space layout as required by NaCl on ARM and ATOM CPUs. In passing, simplify some shared elements of launching NaCl modules in Chrome. This is an update to a previously reverted CL. Please see http://codereview.chromium.org/6995121 for the earlier reviews. Patching nacl_helper CL into fresh branch. BUG=nativeclient:480 TEST=nativeclient in-browser tests TBR=jam@chromium.org TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7230057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90813 0039d316-1c4b-4281-b951-d872f2087c98
* I am submitting this with LGTMs from agl@ and evanm@. I'm marking this as ↵bradchen@google.com2011-06-281-0/+119
| | | | | | | | | | | | | | | | | | | | TBR=jam@ because he is on vacation. He previously LGTMed the reverted CL (link below) and there are not substantive changes since then. Modify the Chrome Linux zygote to support a nacl_helper executable, facilitating a special address-space layout as required by NaCl on ARM and ATOM CPUs. In passing, simplify some shared elements of launching NaCl modules in Chrome. This is an update to a previously reverted CL. Please see http://codereview.chromium.org/6995121 for the earlier reviews. Patching nacl_helper CL into fresh branch. BUG=nativeclient:480 TEST=nativeclient in-browser tests TBR=jam@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90805 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 90681 - New NaCl zygote implementation 2, in which Chrome zygote ↵fischman@chromium.org2011-06-281-113/+0
| | | | | | | | | | | | | | | | forks a NaCl helper. This patch can launch earth_c.html with and without the SUID sandbox. It is enabled with the environment variable NACL_NEW_ZYGOTE. BUG=nativeclient:480 TEST=nativeclient in-browser tests on Linux, ChromeOS Review URL: http://codereview.chromium.org/6995121 TBR=bradchen@google.com Review URL: http://codereview.chromium.org/7274011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90682 0039d316-1c4b-4281-b951-d872f2087c98
* New NaCl zygote implementation 2, in which Chrome zygote forks a NaCl helper.bradchen@google.com2011-06-271-0/+113
This patch can launch earth_c.html with and without the SUID sandbox. It is enabled with the environment variable NACL_NEW_ZYGOTE. BUG=nativeclient:480 TEST=nativeclient in-browser tests on Linux, ChromeOS Review URL: http://codereview.chromium.org/6995121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90681 0039d316-1c4b-4281-b951-d872f2087c98