summaryrefslogtreecommitdiffstats
path: root/sandbox
Commit message (Collapse)AuthorAgeFilesLines
* Linux sandbox: always restrict clone() in baseline policy.jln@chromium.org2014-05-096-15/+164
| | | | | | | | | | | | | | | | | | | | Always restrict clone() to thread creation in the baseline policy. This CL does the following - Extend RestrictCloneToThreadsAndEPERMFork to support Android. - Always EPERM anything that looks like fork() - Add unit tests to the baseline policy related to clone() and fork(). This CL also modifies any other BPF policy so that if clone() was not restricted before, it remains so. That is, only renderers and PPAPI processes have clone() restrictions applied to them, as before. BUG=367986 R=jorgelo@chromium.org, mdempsky@chromium.org Review URL: https://codereview.chromium.org/270613008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269114 0039d316-1c4b-4281-b951-d872f2087c98
* NaCl non-sfi sandbox: use modern framework for testsjln@chromium.org2014-05-071-9/+9
| | | | | | | | | | | | | | | The non-sfi sandbox policy is the implementation of the SandboxBPFPolicy interface but tests are testing it as an old-style function pointer policy. This CL makes use of BPF_TEST_C and BPF_DEATH_TEST_C and takes a classname as a parameter rather than a function pointer. BUG=359285 R=mseaborn@chromium.org Review URL: https://codereview.chromium.org/269333004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268963 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: implement new BPF testing macrosjln@chromium.org2014-05-075-89/+243
| | | | | | | | | | | | | Implement new BPF_TEST_C and BPF_TEST_D macros to allow writing new BPF tests without using the deprecated "BPF policies as function pointers". BUG=368970 R=mdempsky@chromium.org TBR=jorgelo Review URL: https://codereview.chromium.org/269303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268668 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: cleanup test framework furtherjln@chromium.org2014-05-0611-91/+289
| | | | | | | | | | | | | | | | | Remove more void* in favor of strong typing. Create a new global SandboxTestRunner interface that can be implemented by specific test runners. Implement BPF_TEST via a SandboxBPFTestRunner class which takes a delegate to implement allocating the BPF policy and actually running the function. This allows us to confine templating to this new BPFTesterSimpleDelegate class. BUG=368970 R=jorgelo@chromium.org, mdempsky@chromium.org Review URL: https://codereview.chromium.org/265283003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268608 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of kZygoteIdFd from contentmdempsky@chromium.org2014-05-022-45/+64
| | | | | | | | Move handling of the dummy file descriptor into SetuidSandboxClient. Review URL: https://codereview.chromium.org/262533004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267743 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: add basic DEPS files.jln@chromium.org2014-05-024-0/+35
| | | | | | | | | | This is a reland of https://chromiumcodereview.appspot.com/260833002/ TBR=rsesek NOTRY=true Review URL: https://codereview.chromium.org/260893015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267714 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: get rid of a number of reinterpret_castjln@chromium.org2014-05-0210-74/+243
| | | | | | | | | | | | Bring back a little bit of sanity to BPF_TEST. Remove a lot of void* types and their associated reinterpret_cast and enjoy type checking. BUG=368970 R=jorgelo@chromium.org, mdempsky@chromium.org Review URL: https://codereview.chromium.org/260963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267695 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 267599 "Linux sandbox: add basic DEPS files."noamsml@google.com2014-05-014-35/+0
| | | | | | | | | | | | | | | | | Seems to cause issues with Linux bots > Linux sandbox: add basic DEPS files. > > TBR=brettw > NOTRY=true > > Review URL: https://codereview.chromium.org/260833002 TBR=jln@chromium.org Review URL: https://codereview.chromium.org/266673007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267604 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: add basic DEPS files.jln@chromium.org2014-05-014-0/+35
| | | | | | | | | TBR=brettw NOTRY=true Review URL: https://codereview.chromium.org/260833002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267599 0039d316-1c4b-4281-b951-d872f2087c98
* Change UnixDomainSocket::RecvMsg to return ScopedVector<base::ScopedFD>mdempsky@chromium.org2014-04-302-12/+8
| | | | | | | | | | | | | This is slightly suboptimal because ScopedVector forces each ScopedFD to be individually heap allocated, but it's the simplest solution until C++11 is available. BUG=360274 NOTRY=true Review URL: https://codereview.chromium.org/258543006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267350 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: put back sigaltstack in syscall sets.jln@chromium.org2014-04-301-0/+1
| | | | | | | | | | | | r267220 mistakenly removed sigaltstack. BUG=302040 TBR=glider NOTRY=true Review URL: https://codereview.chromium.org/253193005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267325 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: disallow fork() and *kill for ASANjln@chromium.org2014-04-301-55/+27
| | | | | | | | | | | Treat ASAN like non-ASAN and disallow fork() and *kill there as well. BUG=367986 R=jorgelo@chromium.org Review URL: https://codereview.chromium.org/263563004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267292 0039d316-1c4b-4281-b951-d872f2087c98
* Enable use_sigaltstack=1 for ASan builds. This will ease the stack overflow ↵glider@chromium.org2014-04-302-1/+7
| | | | | | | | | | | | | | detection. Also whitelist __NR_sigaltstack in seccomp-bpf under ASan. BUG=302040 R=jln@chromium.org TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/253753003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267220 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: allow *kill on ASANjln@chromium.org2014-04-301-12/+30
| | | | | | | | | | | | Restricting *kill on ASAN is crashing somehow. Allow *kill on ASAN for now. BUG=367986 R=jorgelo@chromium.org, mdempsky@chromium.org Review URL: https://codereview.chromium.org/261543003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267005 0039d316-1c4b-4281-b951-d872f2087c98
* Linux sandbox: restrict *kill to the current process.jln@chromium.org2014-04-297-11/+73
| | | | | | | | | | | Restrict tgkill(2) and kill(2) to the current process, forbid tkill. BUG=367986 R=jorgelo@chromium.org Review URL: https://codereview.chromium.org/258073008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266926 0039d316-1c4b-4281-b951-d872f2087c98
* Create a dummy sandbox_mac_unittests target.rsesek@chromium.org2014-04-293-0/+36
| | | | | | | | | | | This will allow the test suite to be added to buildbot before any real code lands, so it can be properly tested. BUG=367863 Review URL: https://codereview.chromium.org/252073002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266740 0039d316-1c4b-4281-b951-d872f2087c98
* NaCl Linux: create NaClSandbox classjln@chromium.org2014-04-291-1/+1
| | | | | | | | | | | | | | | We create a new NaClSandbox class, with InitializeLayerOneSandbox() and InitializeLayerTwoSandbox() methods. This class centralizes existing code and adds important security checks as to whether or not threads are running or directory file descriptors are open. BUG=359230, 358719 R=mseaborn@chromium.org Review URL: https://codereview.chromium.org/250773003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266735 0039d316-1c4b-4281-b951-d872f2087c98
* Add tests to make sure UnixDomainSocket and namespaces play nicelymdempsky@chromium.org2014-04-282-0/+268
| | | | | | | | BUG=357670 Review URL: https://codereview.chromium.org/259763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266483 0039d316-1c4b-4281-b951-d872f2087c98
* 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