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

Unified Diff: content/common/sandbox_init_linux.cc

Issue 10885021: Linux: add a seccomp-bpf sandbox for renderers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | content/common/sandbox_linux.cc » ('j') | content/common/sandbox_seccomp_bpf_linux.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_init_linux.cc
diff --git a/content/common/sandbox_init_linux.cc b/content/common/sandbox_init_linux.cc
index 56830a4abb436d047c83fe54860e49245fee609c..1c59e9e6a8f50cd47ad90959d30bbca0303732c8 100644
--- a/content/common/sandbox_init_linux.cc
+++ b/content/common/sandbox_init_linux.cc
@@ -33,15 +33,12 @@ bool InitializeSandbox() {
return false;
}
- // First, try to enable seccomp-legacy.
- seccomp_legacy_started = linux_sandbox->StartSeccompLegacy(process_type);
-
- // Then, try to enable seccomp-bpf.
- // If seccomp-legacy is enabled, seccomp-bpf initialization will crash
- // instead of failing gracefully.
- // TODO(markus): fix this (crbug.com/139872).
- if (!seccomp_legacy_started) {
- seccomp_bpf_started = linux_sandbox->StartSeccompBpf(process_type);
+ // First, try to enable seccomp-bpf.
+ seccomp_bpf_started = linux_sandbox->StartSeccompBpf(process_type);
+
+ // If that fails, try to enable seccomp-legacy.
+ if (!seccomp_bpf_started) {
+ seccomp_legacy_started = linux_sandbox->StartSeccompLegacy(process_type);
}
return seccomp_legacy_started || seccomp_bpf_started;
« no previous file with comments | « no previous file | content/common/sandbox_linux.cc » ('j') | content/common/sandbox_seccomp_bpf_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698