summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 17:58:55 +0000
committermarkus@chromium.org <markus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 17:58:55 +0000
commit48a69110f29e0fa819401bd9bef3b6d377d6cb91 (patch)
treea3ba00e8fa6350ba46fd29949f2b2d5261478cf2
parent9725e6e2e7779be0ce10fe42443735dac8145149 (diff)
downloadchromium_src-48a69110f29e0fa819401bd9bef3b6d377d6cb91.zip
chromium_src-48a69110f29e0fa819401bd9bef3b6d377d6cb91.tar.gz
chromium_src-48a69110f29e0fa819401bd9bef3b6d377d6cb91.tar.bz2
Roll the revision of the seccomp sandbox forward. In the process, we also
fixed a missing include file in the zygote, that effectively disabled the entire sandbox. This apparently happened recently, when the zygote code was refactored. BUG=n/a TEST=SECCOMP_SANDBOX_DEBUGGING=1 ./out/Debug/chrome --enable-seccomp-sandbox, then verify that the sandbox is actually activated; it should be printing log data to the console Review URL: https://chromiumcodereview.appspot.com/10407036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138521 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--content/zygote/zygote_linux.cc14
-rw-r--r--content/zygote/zygote_main_linux.cc2
3 files changed, 10 insertions, 8 deletions
diff --git a/DEPS b/DEPS
index da32a01..01c8d25 100644
--- a/DEPS
+++ b/DEPS
@@ -77,7 +77,7 @@ deps = {
(Var("googlecode_url") % "google-url") + "/trunk@175",
"src/seccompsandbox":
- (Var("googlecode_url") % "seccompsandbox") + "/trunk@178",
+ (Var("googlecode_url") % "seccompsandbox") + "/trunk@186",
"src/sdch/open-vcdiff":
(Var("googlecode_url") % "open-vcdiff") + "/trunk@42",
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index cf57999..ff50f24 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -4,6 +4,7 @@
#include "content/zygote/zygote_linux.h"
+#include <fcntl.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
@@ -23,6 +24,7 @@
#include "base/logging.h"
#include "base/pickle.h"
#include "content/common/chrome_descriptors.h"
+#include "content/common/seccomp_sandbox.h"
#include "content/common/set_process_title.h"
#include "content/common/unix_domain_socket_posix.h"
#include "content/public/common/zygote_fork_delegate_linux.h"
@@ -396,15 +398,13 @@ base::ProcessId Zygote::ReadArgsAndFork(const Pickle& pickle,
if (!child_pid) {
// This is the child process.
#if defined(SECCOMP_SANDBOX)
- if (SeccompSandboxEnabled() && proc_fd_for_seccomp_ >= 0) {
- // Try to open /proc/self/maps as the seccomp sandbox needs access to it
- int proc_self_maps = openat(proc_fd_for_seccomp_, "self/maps", O_RDONLY);
- if (proc_self_maps >= 0) {
- SeccompSandboxSetProcSelfMaps(proc_self_maps);
+ if (proc_fd_for_seccomp_ >= 0) {
+ if (process_type == switches::kRendererProcess &&
+ SeccompSandboxEnabled()) {
+ SeccompSandboxSetProcFd(proc_fd_for_seccomp_);
} else {
- PLOG(ERROR) << "openat(/proc/self/maps)";
+ close(proc_fd_for_seccomp_);
}
- close(proc_fd_for_seccomp_);
proc_fd_for_seccomp_ = -1;
}
#endif
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index 21c09c4..2cb2af1 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -669,6 +669,8 @@ bool ZygoteMain(const MainFunctionParams& params,
LOG(ERROR) << "WARNING! This machine lacks support needed for the "
"Seccomp sandbox. Running renderers with Seccomp "
"sandboxing disabled.";
+ close(proc_fd_for_seccomp);
+ proc_fd_for_seccomp = -1;
} else {
VLOG(1) << "Enabling experimental Seccomp sandbox.";
sandbox_flags |= kSandboxLinuxSeccomp;