summaryrefslogtreecommitdiffstats
path: root/sandbox/linux/seccomp/open.cc
diff options
context:
space:
mode:
authormarkus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-07 06:09:38 +0000
committermarkus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-07 06:09:38 +0000
commita9c54a176540e3a8173d72a1794cac3855bc9ce0 (patch)
tree7d316f2558c7e4f923d0c97ef45c4ed08b59cb45 /sandbox/linux/seccomp/open.cc
parent282f4d24b40587c701ede40b014035ceffc9a3ea (diff)
downloadchromium_src-a9c54a176540e3a8173d72a1794cac3855bc9ce0.zip
chromium_src-a9c54a176540e3a8173d72a1794cac3855bc9ce0.tar.gz
chromium_src-a9c54a176540e3a8173d72a1794cac3855bc9ce0.tar.bz2
Allow the seccomp sandbox to be enabled, even if the suid sandbox has
already put a chroot() jail around it. The only tricky part is access to /proc/self/maps, but we can safely pass in an open file descriptor. BUG=26527 Review URL: http://codereview.chromium.org/371047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/linux/seccomp/open.cc')
-rw-r--r--sandbox/linux/seccomp/open.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sandbox/linux/seccomp/open.cc b/sandbox/linux/seccomp/open.cc
index 9b4786b..982d768 100644
--- a/sandbox/linux/seccomp/open.cc
+++ b/sandbox/linux/seccomp/open.cc
@@ -30,7 +30,7 @@ int Sandbox::sandbox_open(const char *pathname, int flags, mode_t mode) {
return static_cast<int>(rc);
}
-bool Sandbox::process_open(int parentProc, int sandboxFd, int threadFdPub,
+bool Sandbox::process_open(int parentMapsFd, int sandboxFd, int threadFdPub,
int threadFd, SecureMem::Args* mem) {
// Read request
SysCalls sys;
@@ -70,7 +70,7 @@ bool Sandbox::process_open(int parentProc, int sandboxFd, int threadFdPub,
return false;
}
- SecureMem::lockSystemCall(parentProc, mem);
+ SecureMem::lockSystemCall(parentMapsFd, mem);
if (read(sys, sandboxFd, mem->pathname, open_req.path_length) !=
(ssize_t)open_req.path_length) {
goto read_parm_failed;
@@ -83,7 +83,7 @@ bool Sandbox::process_open(int parentProc, int sandboxFd, int threadFdPub,
"\"").c_str());
// Tell trusted thread to open the file.
- SecureMem::sendSystemCall(threadFdPub, true, parentProc, mem, __NR_open,
+ SecureMem::sendSystemCall(threadFdPub, true, parentMapsFd, mem, __NR_open,
mem->pathname - (char*)mem + (char*)mem->self,
open_req.flags, open_req.mode);
return true;