summaryrefslogtreecommitdiffstats
path: root/sandbox
Commit message (Collapse)AuthorAgeFilesLines
* Sandbox Linux Unittests: fix silly spurious errorjln@chromium.org2014-04-181-1/+2
| | | | | | | | | | | | When threads are allowed before fork, an error message is always printed, even if there are no threads. BUG=364751 TBR=jln Review URL: https://codereview.chromium.org/242773002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264750 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox test: temporarily allow fork() with threadsjln@chromium.org2014-04-182-10/+22
| | | | | | | | | | | | | In sandbox tests, we temporarily allow fork() with threads. BUG=364751 R=hamaji@chromium.org TBR=mseaborn NOTRY=true Review URL: https://codereview.chromium.org/242383003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264747 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox tests: wait for threads to disappear.jln@chromium.org2014-04-181-5/+23
| | | | | | | | | | | | | | | | Linux sandbox tests are careful about never forking with threads. Since multiple tests can run within the same process, threads might have been started and then stopped. Unfortunately, the Linux kernel can show these threads as still running. We now poll /proc with an exponential back-off before failing the test. BUG=359285 R=hamaji@chromium.org, mdempsky@chromium.org Review URL: https://codereview.chromium.org/242253003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264686 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused input_shlib_pathcjhopman@chromium.org2014-04-171-4/+0
| | | | | | | | | | This path is now only inferred from test_suite_name. TBR=darin NOTRY=true Review URL: https://codereview.chromium.org/226353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264666 0039d316-1c4b-4281-b951-d872f2087c98
* Reland: Add seccomp sandbox for non-SFI NaClhamaji@chromium.org2014-04-176-8/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the reland of https://codereview.chromium.org/196793023/ In the old patch, ldflags! for ASan was specified in nacl_loader target, which is a static_library. Now we set this in nacl_helper target. The diff from the previous change is: https://codereview.chromium.org/240783003/ All syscalls except whitelisted ones will cause SIGSYS. We test the sandbox with BPF_TEST and BPF_TEST_DEATH, which appropriately fork the process so the main process of the test will never enable the sandbox. TEST=Our app works with this sandbox on i686 and ARM TEST=Build chrome and nacl_helper on i686, x86-64, and ARM TEST=./out/Release/components_unittests --gtest_filter='NaClNonSfi*' TEST=SFI NaCl apps still work TEST=trybots BUG=359285 R=jln@chromium.org, mseaborn@chromium.org TBR=jochen Review URL: https://codereview.chromium.org/239703011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264651 0039d316-1c4b-4281-b951-d872f2087c98
* Broker process unittest build fail after r263147pgal.u-szeged@partner.samsung.com2014-04-171-0/+1
| | | | | | | | | | | After the r263147 the unittest build for the broker process fails with unknown type error. Add the missing include which defines the type. BUG=364058 Review URL: https://codereview.chromium.org/239053005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264505 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Add seccomp sandbox for non-SFI NaCl ↵jln@chromium.org2014-04-175-55/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/196793023/) Reason for revert: Broke ASAN on main WF. /b/build/slave/Linux_ASan_LSan_Builder/build/src/third_party/binutils/Linux_x64/Release/bin/ld: error: obj/base/libsanitizer_options.a(obj/base/debug/sanitizer_options.sanitizer_options.o): multiple definition of '__asan_default_options' /b/build/slave/Linux_ASan_LSan_Builder/build/src/third_party/binutils/Linux_x64/Release/bin/ld: obj/components/nacl/loader/nacl_helper.nacl_helper_linux.o: previous definition here clang: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. Original issue's description: > Add seccomp sandbox for non-SFI NaCl > > All syscalls except whitelisted ones will cause SIGSYS. > > We test the sandbox with BPF_TEST and BPF_TEST_DEATH, which appropriately fork the process so the main process of the test will never enable the sandbox. > > TEST=Our app works with this sandbox on i686 and ARM > TEST=Build chrome and nacl_helper on i686, x86-64, and ARM > TEST=./out/Release/components_unittests --gtest_filter='NaClNonSfi*' > # on i686, x86-64, and ARM > TEST=SFI NaCl apps still work > TEST=trybots > BUG=359285 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=264383 TBR=mseaborn@chromium.org,wad@chromium.org,jochen@chromium.org,hamaji@chromium.org NOTREECHECKS=true NOTRY=true BUG=359285 Review URL: https://codereview.chromium.org/240613003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264384 0039d316-1c4b-4281-b951-d872f2087c98
* Add seccomp sandbox for non-SFI NaClhamaji@chromium.org2014-04-175-8/+55
| | | | | | | | | | | | | | | | | | All syscalls except whitelisted ones will cause SIGSYS. We test the sandbox with BPF_TEST and BPF_TEST_DEATH, which appropriately fork the process so the main process of the test will never enable the sandbox. TEST=Our app works with this sandbox on i686 and ARM TEST=Build chrome and nacl_helper on i686, x86-64, and ARM TEST=./out/Release/components_unittests --gtest_filter='NaClNonSfi*' # on i686, x86-64, and ARM TEST=SFI NaCl apps still work TEST=trybots BUG=359285 Review URL: https://codereview.chromium.org/196793023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264383 0039d316-1c4b-4281-b951-d872f2087c98
* NaCl Linux: use own setuid sandbox instancejln@chromium.org2014-04-172-10/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NaCl now uses its own instance of the setuid sandbox. In particular, NaCl is now running in its own PID namespace (which is a sub-space of the Zygote PID namespace). Moreover, the NaCl helper is responsible for getting chrooted, instead of relying on a shared FS view (via CLONE_FS) with the Zygote. This CL also ensures consistency between the setuid sandbox status as reported in about:sandbox and NaCl's setuid sandbox status. Before, the process tree looks like this: __browser ____chrome-sandbox [X, fs_state1] ______init [pid_ns1, fs_state1] ________zygote [pid_ns1, fs_state1] ________nacl_helper [pid_ns1, fs_state1] -- "X" means same as parent. After: __browser ____chrome-sandbox [X , fs_state1] ______init [pid_ns1, fs_state1] ________zygote [pid_ns1, fs_state1] ________chrome-sandbox [pid_ns1, fs_state2] __________nacl_helper [pid_ns2, fs_state2] (nacl_helper doubles as init(1) in pid_ns2). The main change is to make nacl_fork_delegate_linux.cc launch nacl_helper via chrome-sandbox instead trying to share the view of the file system with the Zygote via CLONE_FS. It uses SetuidSandboxClient to help with this. Then change nacl_helper_linux.cc to tell (via IPC) chrome-sandbox to enable the sandbox, and add some more sanity checks. BUG=358733 R=mseaborn@chromium.org, piman@chromium.org Review URL: https://codereview.chromium.org/239803003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264372 0039d316-1c4b-4281-b951-d872f2087c98
* Linux Sandbox: Move setuid sandbox localization code.jln@chromium.org2014-04-153-2/+88
| | | | | | | | | | | | Move the code that finds the setuid sandbox binary to the SetuidSandboxClient class. BUG=358733 R=mdempsky@chromium.org, piman@chromium.org Review URL: https://codereview.chromium.org/238153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263792 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: style cleanup for setuid sandbox.jln@chromium.org2014-04-147-55/+52
| | | | | | | | R=rsesek@chromium.org Review URL: https://codereview.chromium.org/236083002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263695 0039d316-1c4b-4281-b951-d872f2087c98
* Fix BrokerProcess.RecvMsgDescriptorLeak under Valgrindmdempsky@chromium.org2014-04-121-2/+8
| | | | | | | | | | | | | Valgrind seemingly doesn't allow processes to use setrlimit() to lower their hard file descriptor limit. So instead of lowering both our soft and hard file descriptor limit, this CL changes the test so we only lower our soft descriptor limit. BUG=362376 Review URL: https://codereview.chromium.org/235573003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263419 0039d316-1c4b-4281-b951-d872f2087c98
* Enable the new test launcher for sandbox_linux_unittestsphajdan.jr@chromium.org2014-04-114-18/+10
| | | | | | | | | BUG=355084, 236893 R=jln@chromium.org Review URL: https://codereview.chromium.org/221873004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263213 0039d316-1c4b-4281-b951-d872f2087c98
* Add unit test to check for broker FD leakmdempsky@chromium.org2014-04-115-0/+90
| | | | | | | | BUG=360274 Review URL: https://codereview.chromium.org/229893002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263147 0039d316-1c4b-4281-b951-d872f2087c98
* sandbox_bpf_unittest.cc: Remove old code.jorgelo@chromium.org2014-04-101-7/+0
| | | | | | | | | BUG=None TEST=Passes on daisy-spring (ARM device). Review URL: https://codereview.chromium.org/231843008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263121 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes for sandbox unit tests on Androidzhenyu.liang@intel.com2014-04-101-0/+26
| | | | | | | | | | In bionic, open, access and dup2 are wrappers of openat, faccessat and dup3 instead of real syscalls. BUG=166704 Review URL: https://codereview.chromium.org/226923003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263107 0039d316-1c4b-4281-b951-d872f2087c98
* Always output seccomp error messages to stderrhamaji@chromium.org2014-04-091-10/+9
| | | | | | | | | | | | Also now we always use WriteToStderr and move comments to appropriate positions. TEST=trybots BUG=359285 Review URL: https://codereview.chromium.org/231423002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262829 0039d316-1c4b-4281-b951-d872f2087c98
* [Linux] Use PR_SET_NO_NEW_PRIVS by default in base/process/launch.h.rsesek@chromium.org2014-04-091-3/+11
| | | | | | | | | BUG=358713 R=jln@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/197213015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262786 0039d316-1c4b-4281-b951-d872f2087c98
* Switch broker_process.cc to use ScopedFD.mdempsky@chromium.org2014-04-091-5/+9
| | | | | | | | | BUG=360274 NOTRY=true Review URL: https://codereview.chromium.org/229383003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262586 0039d316-1c4b-4281-b951-d872f2087c98
* Removed a single legacy windows function from the sandbox code.Blurrech@gmail.com2014-04-079-76/+2
| | | | | | | | | | Specifically, Win2k code and mainly the function: IsXPSP2OrLater() BUG=151624 Review URL: https://codereview.chromium.org/227163009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262197 0039d316-1c4b-4281-b951-d872f2087c98
* sandbox: Add support for starting seccomp-bpf with threads.rsesek@chromium.org2014-04-055-13/+58
| | | | | | | | | | | | | | | This requires an experimental kernel patch that has not yet been accepted upstream. However this is a prerequisite for getting running seccomp-bpf under Android. BUG=308763, 308775 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=261951 Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=261959 Review URL: https://codereview.chromium.org/224403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262035 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of sandbox: Add support for starting seccomp-bpf with threads. ↵scottmg@chromium.org2014-04-055-56/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/224403002/) Reason for revert: Failed compile on http://build.chromium.org/p/chromium.linux/builders/Linux%20Clang%20%28dbg%29/builds/57969/steps/compile/logs/stdio Original issue's description: > sandbox: Add support for starting seccomp-bpf with threads. > > This requires an experimental kernel patch that has not yet been accepted > upstream. However this is a prerequisite for getting running seccomp-bpf under > Android. > > BUG=308763, 308775 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=261951 TBR=jln@chromium.org,rsesek@chromium.org NOTREECHECKS=true NOTRY=true BUG=308763, 308775 Review URL: https://codereview.chromium.org/226693004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261959 0039d316-1c4b-4281-b951-d872f2087c98
* sandbox: Add support for starting seccomp-bpf with threads.rsesek@chromium.org2014-04-055-13/+56
| | | | | | | | | | | | This requires an experimental kernel patch that has not yet been accepted upstream. However this is a prerequisite for getting running seccomp-bpf under Android. BUG=308763, 308775 Review URL: https://codereview.chromium.org/224403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261951 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: componentize almost everything.jln@chromium.org2014-04-0512-24/+52
| | | | | | | | | | | | | | Componentize seccomp_bpf_helpers, sandbox_services and suid_sandbox_client. libc_urandom_override is special since it uses weak symbols hackery. BUG=360124 R=mdempsky@chromium.org TBR=jln Review URL: https://codereview.chromium.org/226083005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261945 0039d316-1c4b-4281-b951-d872f2087c98
* Fix clang warnings and errors in sandbox/winrnk@chromium.org2014-04-044-10/+9
| | | | | | | | | | | | | | | | | | | | | | | - Add final to BrokerServicesBase. This silences an instance of -Wdelete-non-virtual-dtor. BrokerServicesBase has virtual methods, but no virtual dtor, so Clang thinks it might call the wrong dtor. - Change local wchar_t arrays to pointers before passing them to CrossCall. Clang does template deduction before array to pointer decay occurs, so we end up with ~14 element wchar_t array instead of a pointer. The cross call machinery wants the IPC parameters to be 4 bytes only, so this fails a static_assert in the template. - Return NULL from a function returning a pointer instead of false, which was being implicitly converted to a null pointer. - Remove some unnecessary token pasting from policy_opcodes_unittests.cc. There's no need to paste '.' or '<' with member to form a single token. - Use "42UL" instead of "unsigned long(42)", which I don't think is valid C++. R=cpu@chromium.org,thakis@chromium.org BUG=82385 Review URL: https://codereview.chromium.org/224793003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261907 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: make seccomp_bpf a component target.jln@chromium.org2014-04-049-36/+78
| | | | | | | | | | | | | | | Make sure that for component builds, seccomp_bpf gets built as a .so library. This should prevent duplicated implementations from living in a given process, which breaks singletons. BUG=360124 R=rsesek@chromium.org Review URL: https://codereview.chromium.org/226253004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261892 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: add unit test sanity check.jln@chromium.org2014-04-041-0/+21
| | | | | | | | | | | Explicitly check that it's ok for a subprocess to use exit(3) instead of exit(2) without breaking the test suite. TBR=jln Review URL: https://codereview.chromium.org/224953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261651 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox tests: change a magic exit code value.jln@chromium.org2014-04-031-1/+3
| | | | | | | | | | | Change kExpectedExitCode to avoid a collision with kExpectedValue. R=mdempsky@chromium.org TBR=jln Review URL: https://codereview.chromium.org/224843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261577 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: reformat codegen_unittest.ccjln@chromium.org2014-03-311-81/+76
| | | | | | | | | | Reformat codegen_unittest.cc according to the Chromium style guide. R=rsesek@chromium.org Review URL: https://codereview.chromium.org/218623012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260659 0039d316-1c4b-4281-b951-d872f2087c98
* Linux Sandbox: fix BPF compiler bugjln@chromium.org2014-03-282-1/+121
| | | | | | | | | | | | | | | | | The code responsible for detecting similar blocks and merging them didn't check for the next blocks if the last instruction was not a JMP or a RET. The patch to fix this bug (in codegen.cc) is based on a patch by jld@panix.com, attached to the bug report. Additional unittests are from jln@chromium.org BUG=351103 Review URL: https://codereview.chromium.org/215173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260157 0039d316-1c4b-4281-b951-d872f2087c98
* Fix masking error in InterceptionManager::PatchNtdlljschuh@chromium.org2014-03-281-1/+1
| | | | | | | | | | | BUG=344415 R=rvargas TBR=rvargas NOTRY=true Review URL: https://codereview.chromium.org/215363005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260135 0039d316-1c4b-4281-b951-d872f2087c98
* Add HANDLE_EINTR in some places missing it.brettw@chromium.org2014-03-271-1/+1
| | | | | | | | | | | This implements agl's comments on https://codereview.chromium.org/191673003/ R=agl@chromium.org TBR=agl Review URL: https://codereview.chromium.org/203213005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259986 0039d316-1c4b-4281-b951-d872f2087c98
* Add x86_64 ucontext structure for Android x64zhenyu.liang@intel.com2014-03-272-0/+90
| | | | | | | | BUG=346626 Review URL: https://codereview.chromium.org/204983015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259817 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: disable bare BPF tests on TSANv2thakis@chromium.org2014-03-261-2/+2
| | | | | | | | | | | | BUG=356588 NOTRY=true R=thakis@chromium.org Review URL: https://codereview.chromium.org/213103006 Patch from Julien Tinnes <jln@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259724 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: do not associate SIGSYS with the StackDumpSignalHandlerjln@chromium.org2014-03-261-2/+5
| | | | | | | | | | | | | | | On Linux, SIGSYS is reserved for the kernel's seccomp-bpf feature, so don't set a handler for it before engaging the sandbox. When we engage the sandbow we DLOG(FATAL) if there is an existing signal handler for SIGSYS. BUG=355453 NOTRY=true Review URL: https://codereview.chromium.org/209323012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259471 0039d316-1c4b-4281-b951-d872f2087c98
* Make seccomp-bpf mandatory on ARM.jln@chromium.org2014-03-251-4/+3
| | | | | | | | | | | | | | Seccomp-bpf used to be optional on non Chrome OS ARM bots, since Ubuntu lacked kernel support. Now that Ubuntu has kernel support, make seccomp-bpf mandatory on ARM. BUG=243478 NOTRY=true Review URL: https://codereview.chromium.org/203493007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259094 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: use openat() instead of open() in broker process.jln@chromium.org2014-03-221-3/+18
| | | | | | | | | | | | | | | The broker process needs to perform system calls directly. syscall(__NR_open, ...) was used, however __NR_open doesn't exist on the modern ARM64 architecture. We replace this call with openat(AT_FDCWD, ...). This is a re-land of https://codereview.chromium.org/208823003/ BUG=354852 TBR=jorgelo Review URL: https://codereview.chromium.org/208813006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258793 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 258683 "Linux sandbox: use openat() instead of open() in ..."jln@chromium.org2014-03-211-1/+1
| | | | | | | | | | | | | | | | | | | > Linux sandbox: use openat() instead of open() in broker process. > > The broker process needs to perform system calls directly. > syscall(__NR_open, ...) was used, however __NR_open doesn't exist on > the modern ARM64 architecture. We replace this call with openat(AT_FDCWD, ...). > > BUG=354852 > R=jorgelo@chromium.org > > Review URL: https://codereview.chromium.org/208823003 TBR=jln@chromium.org Review URL: https://codereview.chromium.org/199793009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258710 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: use openat() instead of open() in broker process.jln@chromium.org2014-03-211-1/+1
| | | | | | | | | | | | | The broker process needs to perform system calls directly. syscall(__NR_open, ...) was used, however __NR_open doesn't exist on the modern ARM64 architecture. We replace this call with openat(AT_FDCWD, ...). BUG=354852 R=jorgelo@chromium.org Review URL: https://codereview.chromium.org/208823003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258683 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: add a few missing HANDLE_EINTR()jln@chromium.org2014-03-212-3/+3
| | | | | | | | R=mdempsky@chromium.org Review URL: https://codereview.chromium.org/207353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258470 0039d316-1c4b-4281-b951-d872f2087c98
* Fix DEATH_BY_SIGNAL helpermdempsky@chromium.org2014-03-193-1/+34
| | | | | | | | | | | | For compatibility with old Android versions, we can't rely on abort() raising SIGABRT. Instead, we expect that raise(SIGKILL) will raise SIGKILL. BUG=352226 Review URL: https://codereview.chromium.org/201773003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257889 0039d316-1c4b-4281-b951-d872f2087c98
* Make chrome_elf use thunks instead of function pointers.caitkp@chromium.org2014-03-183-0/+59
| | | | | | | | | | | | | | 1. Add functionality to ServiceResolverThunk to copy a thunk without patching. 2. Move chrome_elf thunk-handling code to a common location. 3. Use a thunk instead of a f'n ptr for redirects. BUG=334379 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255151 Review URL: https://codereview.chromium.org/183833004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257749 0039d316-1c4b-4281-b951-d872f2087c98
* Move ScopedFILE to base namespace and scoped_file.hbrettw@chromium.org2014-03-171-1/+1
| | | | | | | | R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/196073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257518 0039d316-1c4b-4281-b951-d872f2087c98
* Implement ScopedFD in terms of ScopedGeneric.brettw@chromium.org2014-03-174-19/+18
| | | | | | | | | | | | | | | Move to a new file base/files/scoped_file.h. I will also add ScopedFILE to here (currently in file_util.h) later. I think there is a crash in the old code in content/browser/zygote_host/zygote_host_impl_linux.cc that this patch should fix. The old ScopedFD took the address of something in a vector that is being modified. I removed SafeScopedFD from content/common/sandbox_linux/sandbox_linux.cc since base's ScopedFD not CHECKs on close failure (this is a more recent addition). Reland of https://codereview.chromium.org/191673003/ R=agl, viettrungluu Review URL: https://codereview.chromium.org/202113004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257473 0039d316-1c4b-4281-b951-d872f2087c98
* Don't explicitly set DEP flags on Vistajschuh@chromium.org2014-03-151-3/+1
| | | | | | | | | | | | | | | Mandatory DEP is set in the PE headers so trying to force enable it manually fails without an error code that's not discernable from the no DEP case (so we get a startup crash on Vista). NOTRY=true R=CPU TBR=cpu BUG=352932 Review URL: https://codereview.chromium.org/199523003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257345 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Implement ScopedFD in terms of ScopedGeneric. ↵jochen@chromium.org2014-03-154-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/191673003/) Reason for revert: Doesn't correctly link /mnt/data/b/build/slave/Chromium_Linux_Codesearch/build/src/third_party/gold/gold64: warning: hidden symbol 'base::internal::ScopedFDCloseTraits::Free(int)' in obj/base/files/nacl_helper.scoped_file.o is referenced by DSO lib/libipc.so Original issue's description: > Implement ScopedFD in terms of ScopedGeneric. > > Move to a new file base/files/scoped_file.h. I will also add ScopedFILE to here (currently in file_util.h) later. > > I think there is a crash in the old code in content/browser/zygote_host/zygote_host_impl_linux.cc that this patch should fix. The old ScopedFD took the address of something in a vector that is being modified. > > I removed SafeScopedFD from content/common/sandbox_linux/sandbox_linux.cc since base's ScopedFD not CHECKs on close failure (this is a more recent addition). > > BUG= > R=agl@chromium.org, viettrungluu@chromium.org > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257001 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257179 TBR=viettrungluu@chromium.org,agl@chromium.org,brettw@chromium.org NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.chromium.org/201203002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257323 0039d316-1c4b-4281-b951-d872f2087c98
* Implement ScopedFD in terms of ScopedGeneric.brettw@chromium.org2014-03-144-19/+18
| | | | | | | | | | | | | | | | | Move to a new file base/files/scoped_file.h. I will also add ScopedFILE to here (currently in file_util.h) later. I think there is a crash in the old code in content/browser/zygote_host/zygote_host_impl_linux.cc that this patch should fix. The old ScopedFD took the address of something in a vector that is being modified. I removed SafeScopedFD from content/common/sandbox_linux/sandbox_linux.cc since base's ScopedFD not CHECKs on close failure (this is a more recent addition). BUG= R=agl@chromium.org, viettrungluu@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257001 Review URL: https://codereview.chromium.org/191673003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257179 0039d316-1c4b-4281-b951-d872f2087c98
* Fix unreachable code in sandbox/. Found with MSVC warning 4702.pkasting@chromium.org2014-03-141-2/+3
| | | | | | | | | | | | It looks like this would have made Chrome not use DEP on Vista or something? BUG=346382 TEST=none R=jschuh@chromium.org Review URL: https://codereview.chromium.org/199593003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257155 0039d316-1c4b-4281-b951-d872f2087c98
* Pass expected value as first argument to ASSERT_EQmdempsky@chromium.org2014-03-141-3/+3
| | | | | | | | BUG=352226 Review URL: https://codereview.chromium.org/199603002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257075 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Implement ScopedFD in terms of ScopedGeneric. ↵thakis@chromium.org2014-03-144-18/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/191673003/) Reason for revert: Doesn't build on android: FAILED: /mnt/data/b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/memory/base.discardable_memory_allocator_android.o.d -DV8_DEPRECATION_WARNINGS -DBLINK_SCALE_FILTERS_AT_RECORD_TIME -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DDISABLE_NACL -DCHROMIUM_BUILD -DCOMPONENT_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_CONFIGURATION_POLICY -DENABLE_NEW_GAMEPAD_API=1 -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DENABLE_EGLIMAGE=1 -DENABLE_AUTOFILL_DIALOG=1 -DCLD_VERSION=1 -DENABLE_PRINTING=1 -DENABLE_MANAGED_USERS=1 -DUSE_OPENSSL=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DBASE_IMPLEMENTATION -DANDROID -D__GNU_SOURCE=1 -DUSE_STLPORT=1 -D_STLP_USE_PTR_SPECIALIZATIONS=1 '-DCHROME_BUILD_ID=""' -DHAVE_SYS_UIO_H -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -Igen/base -I../../third_party/android_tools/ndk/sources/android/cpufeatures -I../.. -fstack-protector --param=ssp-buffer-size=4 -Werror -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-reserved-user-defined-literal -Wno-deprecated-register -Xclang -load -Xclang /mnt/data/b/build/slave/Android_Clang_Builder__dbg_/build/src/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-url-directory -fcolor-diagnostics -Wexit-time-destructors -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -no-integrated-as -B/mnt/data/b/build/slave/Android_Clang_Builder__dbg_/build/src/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin -ffunction-sections -funwind-tables -g -fstack-protector -fno-short-enums -Wa,--noexecstack -D__compiler_offsetof=__builtin_offsetof -Dnan=__builtin_nan -target arm-linux-androideabi -mllvm -arm-enable-ehabi --sysroot=/mnt/data/b/build/slave/Android_Clang_Builder__dbg_/build/src/third_party/android_tools/ndk//platforms/android-14/arch-arm -I/mnt/data/b/build/slave/Android_Clang_Builder__dbg_/build/src/third_party/android_tools/ndk//sources/cxx-stl/stlport/stlport -Os -g -fomit-frame-pointer -fdata-sections -ffunction-sections -funwind-tables -g0 -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -std=gnu++11 -Wno-implicit-exception-spec-mismatch -Wno-abi -c ../../base/memory/discardable_memory_allocator_android.cc -o obj/base/memory/base.discardable_memory_allocator_android.o ../../base/memory/discardable_memory_allocator_android.cc:84:25:error: no matching function for call to 'mmap' void* const address = mmap( ^~~~ /mnt/data/b/build/slave/Android_Clang_Builder__dbg_/build/src/third_party/android_tools/ndk//platforms/android-14/arch-arm/usr/include/sys/mman.h:47:15: note: candidate function not viable: no known conversion from 'base::ScopedFD' (aka 'ScopedGeneric<int, internal::ScopedFDCloseTraits>') to 'int' for 5th argument extern void* mmap(void *, size_t, int, int, int, off_t); ^ 1 error generated. Original issue's description: > Implement ScopedFD in terms of ScopedGeneric. > > Move to a new file base/files/scoped_file.h. I will also add ScopedFILE to here (currently in file_util.h) later. > > I think there is a crash in the old code in content/browser/zygote_host/zygote_host_impl_linux.cc that this patch should fix. The old ScopedFD took the address of something in a vector that is being modified. > > I removed SafeScopedFD from content/common/sandbox_linux/sandbox_linux.cc since base's ScopedFD not CHECKs on close failure (this is a more recent addition). > > BUG= > R=agl@chromium.org, viettrungluu@chromium.org > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257001 TBR=viettrungluu@chromium.org,agl@chromium.org,brettw@chromium.org NOTREECHECKS=true NOTRY=true BUG= Review URL: https://codereview.chromium.org/197873014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257005 0039d316-1c4b-4281-b951-d872f2087c98