Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Unified Diff: content/common/sandbox_seccomp_bpf_linux.cc

Issue 10829156: Linux: add BPF sandbox status in about:sandbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_linux.cc ('k') | content/public/common/sandbox_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_seccomp_bpf_linux.cc
diff --git a/content/common/sandbox_seccomp_bpf_linux.cc b/content/common/sandbox_seccomp_bpf_linux.cc
index 3468413c11d920679b9e059024a2eca2da320ea4..5e694f7a29abb263b2155bcc7df231dc512e2394 100644
--- a/content/common/sandbox_seccomp_bpf_linux.cc
+++ b/content/common/sandbox_seccomp_bpf_linux.cc
@@ -510,6 +510,15 @@ bool SandboxSeccompBpf::IsSeccompBpfDesired() {
}
}
+bool SandboxSeccompBpf::ShouldEnableSeccompBpf(
+ const std::string& process_type) {
+#if defined(SECCOMP_BPF_SANDBOX)
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ return !ShouldDisableBpfSandbox(command_line, process_type);
+#endif
+ return false;
+}
+
bool SandboxSeccompBpf::SupportsSandbox() {
#if defined(SECCOMP_BPF_SANDBOX)
// TODO(jln): pass the saved proc_fd_ from the LinuxSandbox singleton
@@ -528,7 +537,7 @@ bool SandboxSeccompBpf::StartSandbox(const std::string& process_type) {
if (IsSeccompBpfDesired() && // Global switches policy.
// Process-specific policy.
- !ShouldDisableBpfSandbox(command_line, process_type) &&
+ ShouldEnableSeccompBpf(process_type) &&
SupportsSandbox()) {
return StartBpfSandbox_x86(command_line, process_type);
}
« no previous file with comments | « content/common/sandbox_linux.cc ('k') | content/public/common/sandbox_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698