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

Unified Diff: content/common/sandbox_bpf_base_policy_linux.cc

Issue 114483003: Revert of Linux Sandbox: split the GPU policies to their own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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_bpf_base_policy_linux.h ('k') | content/common/sandbox_init_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_bpf_base_policy_linux.cc
diff --git a/content/common/sandbox_bpf_base_policy_linux.cc b/content/common/sandbox_bpf_base_policy_linux.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4341e921fa97344bc471d50fb7e4ea320932b873
--- /dev/null
+++ b/content/common/sandbox_bpf_base_policy_linux.cc
@@ -0,0 +1,36 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/sandbox_bpf_base_policy_linux.h"
+
+#include <errno.h>
+
+#include "base/logging.h"
+#include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h"
+
+namespace content {
+
+namespace {
+
+// The errno used for denied file system access system calls, such as open(2).
+static const int kFSDeniedErrno = EPERM;
+
+} // namespace.
+
+SandboxBPFBasePolicy::SandboxBPFBasePolicy()
+ : baseline_policy_(new sandbox::BaselinePolicy(kFSDeniedErrno)) {}
+SandboxBPFBasePolicy::~SandboxBPFBasePolicy() {}
+
+ErrorCode SandboxBPFBasePolicy::EvaluateSyscall(SandboxBPF* sandbox_compiler,
+ int system_call_number) const {
+ DCHECK(baseline_policy_);
+ return baseline_policy_->EvaluateSyscall(sandbox_compiler,
+ system_call_number);
+}
+
+int SandboxBPFBasePolicy::GetFSDeniedErrno() {
+ return kFSDeniedErrno;
+}
+
+} // namespace content.
« no previous file with comments | « content/common/sandbox_bpf_base_policy_linux.h ('k') | content/common/sandbox_init_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698