summaryrefslogtreecommitdiffstats
path: root/sandbox
Commit message (Collapse)AuthorAgeFilesLines
* Avoid the use of wow_helper for Windows7cpu@chromium.org2010-10-291-2/+5
| | | | | | | | | | | | | | | In Windows7 64-bit the wow subsystem maps the 32 bit ntdll from the get go, so there is no need to use wow_helper at all. This also should speed process creation for chrome. BUG=60854 TEST=existing validation and integration tests suffice. Review URL: http://codereview.chromium.org/4185004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64446 0039d316-1c4b-4281-b951-d872f2087c98
* Add a bunch of missing bug references to FLAKY testsstuartmorgan@chromium.org2010-10-271-0/+1
| | | | | | | | | BUG=None TEST=N/A Review URL: http://codereview.chromium.org/4135007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64150 0039d316-1c4b-4281-b951-d872f2087c98
* Move pe_image and registry from base to base/win and use the namespace. It ↵brettw@chromium.org2010-10-178-16/+16
| | | | | | | | | | | | removes windows_message_list which isn't used. This keeps a stub for registry in the old location until we can update that. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3836005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62888 0039d316-1c4b-4281-b951-d872f2087c98
* Move windows version-related stuff out of base/win_util and into ↵brettw@chromium.org2010-10-156-23/+24
| | | | | | | | | | | | | | base/win/windows_version. Many files now only need to include this instead of all of win_util. Remove a bunch of unused code from base/win_util. There was a surprising amount. Replace the AppUserModel property key with the one from the SDK now that we use the Win7 SDK. Move GetLogonSessionOnlyDACL from win_util to ipc since it's only used in that one place. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62694 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 62205 - Make writing to stdout and stderr work in Chrome processes ↵isherman@chromium.org2010-10-121-5/+0
| | | | | | | | | | | | | | | | | | | | | when inherited handles are available. Don't create a console, just attach to any existing console. R=cpu BUG=none TEST=none Review URL: http://codereview.chromium.org/3574008 Reverting because it breaks browser_tests logging TBR=darin@chromium.org Review URL: http://codereview.chromium.org/3691005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62236 0039d316-1c4b-4281-b951-d872f2087c98
* Make writing to stdout and stderr work in Chrome processes when inheriteddarin@chromium.org2010-10-111-0/+5
| | | | | | | | | | | | | | handles are available. Don't create a console, just attach to any existing console. R=cpu BUG=none TEST=none Review URL: http://codereview.chromium.org/3574008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62205 0039d316-1c4b-4281-b951-d872f2087c98
* Sandbox change. Remove inheritance of the duplicated tokens.cpu@chromium.org2010-09-221-4/+4
| | | | | | | | | | | | | I don't think this is necessary at all and coult potentially leak tokens into other child processes. BUG=none TEST=run chrome, verify renderers are sandboxed Review URL: http://codereview.chromium.org/3386012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60136 0039d316-1c4b-4281-b951-d872f2087c98
* Support for building Chrome using Clang.evan@chromium.org2010-09-181-2/+2
| | | | | | | | | | | | | | | | To build, set the clang=1 gyp_define. This patch is the culmination of many months of effort and many patches. It contains the minimal changes to Chrome that are Clang-specific. With this, I can build the "chrome" target. Once this patch is in, we can incrementally fix bits of Chrome and various tests and remove the Clang-specific workarounds. Review URL: http://codereview.chromium.org/522020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59882 0039d316-1c4b-4281-b951-d872f2087c98
* Fix SameObject to not return false when the volume name returned by ↵nsylvain@chromium.org2010-09-161-1/+1
| | | | | | | | | QueryDosDevice ends with more than 2 NULL chars. Review URL: http://codereview.chromium.org/3429010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59719 0039d316-1c4b-4281-b951-d872f2087c98
* Pull seccomp-sandbox in via DEPS rather than using an in-tree copy mseaborn@chromium.org2010-09-0146-14320/+1
| | | | | | | | | | | | | | | | This means changes to the sandbox won't have to be committed twice, to both trees. This is a retry of r57921, which was committed with git-svn and failed to remove the "seccomp" directory. This caused problems when trying to "svn checkout" to the same location, and the change was reverted. This time I will use SVN to commit the change. BUG=none TEST=smoke test of running chromium with --enable-seccomp-sandbox Review URL: http://codereview.chromium.org/3225010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58184 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 57921 - Pull seccomp-sandbox in via DEPS rather than using an in-tree ↵nsylvain@chromium.org2010-08-3145-0/+14319
| | | | | | | | | | | | | | | | | copy This means changes to the sandbox won't have to be committed twice, to both trees. BUG=none TEST=smoke test of running chromium with --enable-seccomp-sandbox Review URL: http://codereview.chromium.org/3249003 TBR=mseaborn@chromium.org Review URL: http://codereview.chromium.org/3245011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57933 0039d316-1c4b-4281-b951-d872f2087c98
* Pull seccomp-sandbox in via DEPS rather than using an in-tree copymseaborn@chromium.org2010-08-3045-14319/+0
| | | | | | | | | | | | This means changes to the sandbox won't have to be committed twice, to both trees. BUG=none TEST=smoke test of running chromium with --enable-seccomp-sandbox Review URL: http://codereview.chromium.org/3249003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57921 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 7)thestig@chromium.org2010-08-271-2/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3176026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57737 0039d316-1c4b-4281-b951-d872f2087c98
* Seccomp sandbox: Add a policy flag to allow file namespace access to be disabledmseaborn@chromium.org2010-08-276-14/+103
| | | | | | | | | | | | | | | | This allows file namespace access to be turned on for the purpose of testing, and we use this in some of the tests, but it is disabled by default. This synchronises the Chromium copy with r88 in the non-Chromium copy of seccomp-sandbox. BUG=none TEST=make test Review URL: http://codereview.chromium.org/3248002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57722 0039d316-1c4b-4281-b951-d872f2087c98
* Remove NEWNS from the setuid sandbox.mal@chromium.org2010-08-261-4/+0
| | | | | | | | | | | This can cause issues with the automounter on ubuntu. R= agl BUG= http://b/2824277 TEST= see bug. Or see traffic on the bug drop to <10 comments/day. Review URL: http://codereview.chromium.org/3146044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57469 0039d316-1c4b-4281-b951-d872f2087c98
* Sbox IPC fixcpu@chromium.org2010-08-203-40/+79
| | | | | | | | | | | | | | Second take, I had off-by-one bad check in line 164 for more info see review 3142022 BUG=52682 TEST=included Review URL: http://codereview.chromium.org/3130037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56938 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 56796 - Sbox IPC fixcpu@chromium.org2010-08-203-72/+39
| | | | | | | | | | | | | | | Tests failing on vista BUG=52682 TEST=included Review URL: http://codereview.chromium.org/3142022 TBR=cpu@chromium.org Review URL: http://codereview.chromium.org/3122031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56798 0039d316-1c4b-4281-b951-d872f2087c98
* Sbox IPC fixcpu@chromium.org2010-08-203-39/+72
| | | | | | | | | | BUG=52682 TEST=included Review URL: http://codereview.chromium.org/3142022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56796 0039d316-1c4b-4281-b951-d872f2087c98
* Allow native (nt-style) paths to be used for sandbox policy specificationcpu@chromium.org2010-08-074-17/+61
| | | | | | | | | | | | | 1- bypass fixup when adding the path into the policy 2- make SameObject() do case-insensitive perfect match BUG=50774 TEST= unit test included Review URL: http://codereview.chromium.org/3092014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55329 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unneeded headers from base/ (part 1)thestig@chromium.org2010-08-053-3/+2
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3071012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55034 0039d316-1c4b-4281-b951-d872f2087c98
* Check the IPC filename length does not exceed the message size.jschuh@google.com2010-07-221-0/+5
| | | | | | | | BUG=49763 TEST=None. Review URL: http://codereview.chromium.org/2806067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53415 0039d316-1c4b-4281-b951-d872f2087c98
* Fix about:sandbox's network isolation indication.agl@chromium.org2010-07-211-1/+1
| | | | | | (aka: agl's an idiot. Thanks Julien.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53180 0039d316-1c4b-4281-b951-d872f2087c98
* Remove <iostream> where possible.erg@google.com2010-07-203-3/+0
| | | | | | | | | | | | | <iostream> creates a static initializer. Most people don't need <iostream> anyway--they really need <ostream> for operator<< overloads. <iostream> should *never* be included in a header file; <iosfwd> exists for that purpose. BUG=none TEST=none Review URL: http://codereview.chromium.org/3014015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53083 0039d316-1c4b-4281-b951-d872f2087c98
* Add about:sandbox.agl@chromium.org2010-07-131-1/+14
| | | | | | | | | | | (Idea from Julien Tinnes) BUG=none TEST=Navigate to about:sandbox on Linux and see the status of the sandbox. http://codereview.chromium.org/2966003/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52176 0039d316-1c4b-4281-b951-d872f2087c98
* Fix compiler error in sandbox util in case exception is enabled.victorw@chromium.org2010-06-222-0/+12
| | | | | | | | | | | | | | | | | Add operator delete that matches the placement form of the operator new. This is required by compiler to generate code to call operator delete in case the object's constructor throws an exception. See http://msdn.microsoft.com/en-us/library/cxdxz3x6.aspx R=rvargas BUG=none TEST=sandbox code compiles if exception is enabled. Review URL: http://codereview.chromium.org/2870017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50486 0039d316-1c4b-4281-b951-d872f2087c98
* FAILS tests should not turn the bot red.vandebo@chromium.org2010-06-181-2/+2
| | | | | | | | | | | | | | | | | | | Revert 50258 - TTF: Reenable some disabled tests. DevToolsSanityTest.TestConsoleLog seems to work ProxyResolverV8Test.FAILS_ReturnUnicode DepTest.FAILS_TestDepDisable VectorCanvasTest.FAILS_Matrix TEST=none BUG=disabled tests Review URL: http://codereview.chromium.org/2819011 TBR=vandebo@chromium.org Review URL: http://codereview.chromium.org/2862016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50261 0039d316-1c4b-4281-b951-d872f2087c98
* TTF: Reenable some disabled tests.vandebo@chromium.org2010-06-181-2/+2
| | | | | | | | | | | | | | DevToolsSanityTest.TestConsoleLog seems to work ProxyResolverV8Test.FAILS_ReturnUnicode DepTest.FAILS_TestDepDisable VectorCanvasTest.FAILS_Matrix TEST=none BUG=disabled tests Review URL: http://codereview.chromium.org/2819011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50258 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 49982 - patchthakis@chromium.org2010-06-161-2/+2
| | | | | | | TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2825006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50002 0039d316-1c4b-4281-b951-d872f2087c98
* patchthakis@chromium.org2010-06-161-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49982 0039d316-1c4b-4281-b951-d872f2087c98
* Rename Chrome threads to use a "Cr" prefix.evan@chromium.org2010-06-091-1/+1
| | | | | | | | | | | Before we carefully used the app (Chrome/Chromium) name, but: 1) these are for internal debugging use only, so why compute this name 2) on Linux the thread ids are limited to 16 characters, and "Chromium" is too long Review URL: http://codereview.chromium.org/2741003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49296 0039d316-1c4b-4281-b951-d872f2087c98
* Use DISALLOW_COPY_AND_ASSIGN instead of DISALLOW_EVIL_CONSTRUCTORS in ↵tfarina@chromium.org2010-06-0523-51/+51
| | | | | | | | | | | sandbox directory. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/2643003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49010 0039d316-1c4b-4281-b951-d872f2087c98
* Implement most of the ridealong fixes/cleanups I suggested during review for ↵pkasting@chromium.org2010-06-012-9/+9
| | | | | | | | | | enabling warn-on-signed-versus-unsigned-equality-comparisions on Windows. BUG=none TEST=none Review URL: http://codereview.chromium.org/2395001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48666 0039d316-1c4b-4281-b951-d872f2087c98
* Enable warning 4389 as an error on windows builds. This will make mbelshe@chromium.org2010-05-275-39/+39
| | | | | | | | | | | | windows builds more similar to linux/mac, which already treat signed/ unsigned equality comparisons as warnings (and hence errors). BUG=44471 TEST=none Review URL: http://codereview.chromium.org/2222002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48395 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Another dependency the bbot missed!!!"rafaelw@chromium.org2010-05-265-39/+39
| | | | | | | | | | | | | | | | | | This reverts commit 161f7fd3bdd425167af9fe26fdc5373a2ff44c98. Revert "Missed a file as part of checkin for r48186" This reverts commit cff86beba5938209393a6c3bccced62a7f3ff36b. Revert "Enable warning 4389 as an error on windows builds. This will make" This reverts commit c78936bcfc65b98edf288191d927a495b0364621. TBR=mbelshe Review URL: http://codereview.chromium.org/2253001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48238 0039d316-1c4b-4281-b951-d872f2087c98
* Enable warning 4389 as an error on windows builds. This will makembelshe@chromium.org2010-05-255-39/+39
| | | | | | | | | | | | windows builds more similar to linux/mac, which already treat signed/ unsigned equality comparisons as warnings (and hence errors). BUG=44471 TEST=none Review URL: http://codereview.chromium.org/2081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48186 0039d316-1c4b-4281-b951-d872f2087c98
* Seccomp sandbox: Add Gyp rules for building the test suitemseaborn@chromium.org2010-05-241-0/+30
| | | | | | | | | | | | | | This should work both standalone and inside the Chromium build. I have not included an action for running the tests, since having such an action does not seem to be common in the Chromium build. BUG=none TEST=seccomp_tests Review URL: http://codereview.chromium.org/2165001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48043 0039d316-1c4b-4281-b951-d872f2087c98
* Add NEWNS and NEWNET to the SUID sandbox.agl@chromium.org2010-05-241-15/+30
| | | | | | | | | | | | | | | | | | | This patch attempts to fork off the sandboxed process with the additional NEWNS and NEWNET flags. If these flags aren't supported at runtime then the code will degrade to the current behaviour. NEWNS starts children in a new mount namespace so that they cannot affect the parent's mounts. (This is a little bit useless every little helps.) NEWNET starts children in a new network space, initially with no network devices and this stops sandboxed processes from talking to the network. Additionally, children exist in their own namespaces for UNIX domain sockets and the abstract namespace. http://codereview.chromium.org/2108020/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48040 0039d316-1c4b-4281-b951-d872f2087c98
* Remove a possible race in the SUID sandbox (minor)agl@chromium.org2010-05-201-7/+18
| | | | | | | | | | | | | | | | | The SUID sandbox can be used to set the oom_adj value for non-dumpable processes owned by the same user. When doing so, we previously first checked the directory owner and then opened the oom_adj file. In between the check and the open, the process could have died and another process could have taken that PID value. We would then adjust the OOM value of the wrong process. Given how PIDs are allocated, this is very hard to exploit and, even then, a minor security issue at best, but we can avoid the issue entirely with openat. http://codereview.chromium.org/2118007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47801 0039d316-1c4b-4281-b951-d872f2087c98
* seccomp sandbox: Split source file list into a separate .gyp filemseaborn@chromium.org2010-05-202-52/+67
| | | | | | | | | | | | | | | | | The intention behind this is to make it easier to sync the .gyp file into the non-Chromium copy of the seccomp sandbox so that it can be used to build a standalone version of the sandbox. Also, it arguably makes the .gyp files more manageable. Removes a dependency on "base", which the seccomp sandbox does not use. BUG=none TEST=none Review URL: http://codereview.chromium.org/1939002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47792 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for calling {rt_,}sigaction(), and for invoking signal handlersmarkus@chromium.org2010-05-1810-66/+625
| | | | | | | | | | | | | | from within the sandbox. Added tests for the new functionality and merged the tests for sigreturn() that had previously been committed to the standalone version of the sandbox (on Google Code) TEST=run "make test" BUG=37728 Review URL: http://codereview.chromium.org/2074003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47561 0039d316-1c4b-4281-b951-d872f2087c98
* seccomp sandbox: Add tests for signal handlingmseaborn@chromium.org2010-05-181-3/+145
| | | | | | | | | | | | | | | | | | | Test that signal handlers can be run OK. This tests the support for sigreturn() (that involves patching the VDSO) that was added in r76 of the non-Chromium version of the sandbox. Test that signal masks can be set and read. This tests the sigprocmask() support that was added in r70. Add a mechanism for checking that a test exits with an expected non-zero exit status, such as SIGSEGV. BUG=none TEST=test_syscalls Review URL: http://codereview.chromium.org/2087013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47541 0039d316-1c4b-4281-b951-d872f2087c98
* GYP changes for FreeBSD and OpenBSDpvalchev@google.com2010-05-141-0/+9
| | | | | | Review URL: http://codereview.chromium.org/1480002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47327 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent FPU state corruption by directly creating the signal frame on themarkus@chromium.org2010-05-114-69/+56
| | | | | | | | | | | | | | stack of the newly created thread, instead of creating it on the caller's stack and copying it over. This eliminates the need to do complicated touch-ups of the signal stack's data structure, which turned out to be incorrect for the FPU state. Thanks to Mark Seaborn for pointing out this simplification of the code. TEST=Chrome no longer crashes in tcmalloc BUG=none Review URL: http://codereview.chromium.org/2051005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46928 0039d316-1c4b-4281-b951-d872f2087c98
* Add a couple more testsmarkus@chromium.org2010-04-281-7/+126
| | | | | | | | | | | | | | | | | | These tests were useful for debugging reference_trusted_thread.cc. Test an easily-forwarded system call, dup(). Also test clone() directly, in addition to testing it indirectly via pthread_create(). Check for leaked FDs. Change the test runner to run all tests, even if one fails, rather than stopping at the first failed test. Review URL: http://codereview.chromium.org/1750014 BUG=none TEST=none Review URL: http://codereview.chromium.org/1756015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45806 0039d316-1c4b-4281-b951-d872f2087c98
* Correctly align memory allocations in the case where we need to allocate memorymarkus@chromium.org2010-04-281-1/+4
| | | | | | | | | | | as far away from the stack as possible, but still as close to the VDSO as we can. BUG=none TEST=run the tests in a tight loop and notice that they no longer randomly fail Review URL: http://codereview.chromium.org/1807002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45775 0039d316-1c4b-4281-b951-d872f2087c98
* Added support for sigreturn() and rt_sigreturn(). On x86-32, this ismarkus@chromium.org2010-04-285-127/+239
| | | | | | | | | | | | | | | | | | | | | | | | | complicated by the fact that in Seccomp mode, we can only ever call sigreturn(). But in order to eventually support sigaction(), we want to be able to also call rt_sigreturn(). We solve this problem by rewriting the signal stack frame from an RT signal frame to a legacy frame. Fortunately, this part of the signal frame is stable between kernel versions. The unstable part (i.e. extended registers such as FP, MMX, SSE, ...) is always identical in both in both types of signal frames. None of these complications exist on x86-64 and it is relatively straight-forward to enable support for the system call. The only difficulty lies in the fact that its calling conventions are somewhat different from "normal" system calls. So, we have to handle rt_sigreturn() from within the syscallWrapper() and the segv() handler and cannot write it in C code. TEST=ad hoc testing until we have support for sigaction(). Then we can add a unittest BUG=37728 Review URL: http://codereview.chromium.org/1739011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45774 0039d316-1c4b-4281-b951-d872f2087c98
* Merged Mark Seaborn's changes:markus@chromium.org2010-04-2218-76/+427
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some automated tests for seccomp-sandbox This covers some of the syscalls that are proxied by the trusted process. This adds a basic test runner framework. Fix error return code for open() and other syscalls on x86-64 On error, the open() syscall was returning errno & 0xffffffff in %rax on x86-64 instead of -errno. This stops glibc from regarding this as an error, and so its syscall wrapper returns -errno instead of -1 and does not set errno. I have fixed up the other syscalls to use long (64-bit) instead of int (32-bit) as well. Not all of them were affected by the problem: it depends on gcc's code generation. Sometimes casting to int truncates a value, sometimes it doesn't. It seems better to be consistent though. Adds a test for open() and some other syscalls. TODO: Need to figure out how to run the tests automatically BUG=none TEST=none Review URL: http://codereview.chromium.org/1729003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45379 0039d316-1c4b-4281-b951-d872f2087c98
* Make the use of signals inside of the sandbox safe.markus@chromium.org2010-04-2012-409/+965
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously assumed that no signals would ever be enabled in the sandbox and thus there was no way to trick the trusted thread into executing potentially untrusted code. In an attempt to lift this restriction, this changelist modifies the trusted thread so that - it has an invalid stack pointer at all times. Any attempt to handle a signal would result in the kernel trying to push a signal stack, which would immediately result in a SEGV and then terminate the application. - all signals are blocked while outside of trusted code. If a signal is triggered, it either gets handled on one of the sandboxed threads (for asynchronous signals), or it results in the application getting terminated by the kernel (for synchronous signals). This changelist is difficult not only because eliminating all uses of the stack pointer requires some very careful assembly coding, but more importantly because we have to restore signals after we enter seccomp mode. As sigprocmask() is a restricted system call, the only way to restore the signal mask is by calling sigreturn() with a suitably tweaked signal stack frame. While the first couple of bytes of the signal stack frame are well-defined and unlikely to change, the entire signal stack frame is not documented as part of the stable ABI. The exact format depends on the number of modified CPU registers (e.g. SSE, MMX, floating point, ...) The only way for us to get a valid signal stack frame is to trigger a signal, and to create a (possibly adjusted) copy of the signal frame. We obviously have to do this _before_ we block all signals upon entering trusted code. The two places where this needs to happen is upon start of the sandbox when launching the initial trusted thread, and upon any call to clone(). BUG=37728 TEST=Run chrome and verify that /proc/$PID/status shows the correct signal mask for trusted threads. The latter can be identified with strace. Review URL: http://codereview.chromium.org/1594040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45055 0039d316-1c4b-4281-b951-d872f2087c98
* SELinux: add basic policy.agl@chromium.org2010-04-193-0/+53
| | | | | | | | | | | | | | | | This patch removes the chromium_zygote_t type and adds a chromium_renderer_t type. Also, a basic policy for chromium_renderer_t is included. I decided not to try to have a different policy for the zygote since it just makes things more complex for little reason. BUG=none TEST=none http://codereview.chromium.org/1104002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44908 0039d316-1c4b-4281-b951-d872f2087c98
* Fix SELinux warnings when running on Fedora.markus@chromium.org2010-03-301-3/+3
| | | | | | | | | | | | (c.f. http://people.redhat.com/drepper/selinux-mem.html) Fix compilation warnings on Fedora. BUG=none TEST=when running Chrome on Fedora, verify that we don't get AVC warnings Review URL: http://codereview.chromium.org/1535004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43107 0039d316-1c4b-4281-b951-d872f2087c98