summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 04:38:10 +0000
committerjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 04:38:10 +0000
commitbd8cd49af45bc48cb421bf267357d327ad7dc427 (patch)
tree5c7466e4eb6d9bd0d6e6b7c5799c9e9e2397a470 /sandbox
parentb6b30ef557c5c6019839cfe9ef76b1874a66ea78 (diff)
downloadchromium_src-bd8cd49af45bc48cb421bf267357d327ad7dc427.zip
chromium_src-bd8cd49af45bc48cb421bf267357d327ad7dc427.tar.gz
chromium_src-bd8cd49af45bc48cb421bf267357d327ad7dc427.tar.bz2
Linux Sandbox: move NaCl to new BPF policy format.
Migrate NaCl to the new BPF policies format. BUG=325535, 267179 R=mseaborn@chromium.org, piman@chromium.org, rsesek@chromium.org Review URL: https://codereview.chromium.org/110833002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/linux/sandbox_linux.gypi1
-rw-r--r--sandbox/linux/seccomp-bpf/sandbox_bpf.h8
-rw-r--r--sandbox/linux/seccomp-bpf/sandbox_bpf_policy_forward.h22
3 files changed, 3 insertions, 28 deletions
diff --git a/sandbox/linux/sandbox_linux.gypi b/sandbox/linux/sandbox_linux.gypi
index 97024cd..c20ab04 100644
--- a/sandbox/linux/sandbox_linux.gypi
+++ b/sandbox/linux/sandbox_linux.gypi
@@ -109,7 +109,6 @@
'seccomp-bpf/sandbox_bpf.cc',
'seccomp-bpf/sandbox_bpf.h',
'seccomp-bpf/sandbox_bpf_policy.h',
- 'seccomp-bpf/sandbox_bpf_policy_forward.h',
'seccomp-bpf/syscall.cc',
'seccomp-bpf/syscall.h',
'seccomp-bpf/syscall_iterator.cc',
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.h b/sandbox/linux/seccomp-bpf/sandbox_bpf.h
index dcb65bf..fef5098 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.h
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.h
@@ -20,7 +20,6 @@
#include "sandbox/linux/seccomp-bpf/die.h"
#include "sandbox/linux/seccomp-bpf/errorcode.h"
#include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
-#include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy_forward.h"
namespace playground2 {
@@ -52,16 +51,15 @@ class Sandbox {
STATUS_ENABLED // The sandbox is now active
};
- // BpfSandboxPolicy is the following type:
- // ErrorCode (Sandbox *sb, int sysnum, void *aux);
// When calling setSandboxPolicy(), the caller can provide an arbitrary
// pointer in |aux|. This pointer will then be forwarded to the sandbox
// policy each time a call is made through an EvaluateSyscall function
// pointer. One common use case would be to pass the "aux" pointer as an
// argument to Trap() functions.
- typedef BpfSandboxPolicy* EvaluateSyscall;
+ typedef ErrorCode (*EvaluateSyscall)(Sandbox* sandbox_compiler,
+ int system_call_number,
+ void* aux);
typedef std::vector<std::pair<EvaluateSyscall, void*> > Evaluators;
-
// A vector of BPF instructions that need to be installed as a filter
// program in the kernel.
typedef std::vector<struct sock_filter> Program;
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_policy_forward.h b/sandbox/linux/seccomp-bpf/sandbox_bpf_policy_forward.h
deleted file mode 100644
index 77d9b53..0000000
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf_policy_forward.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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.
-
-#ifndef SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_POLICY_FORWARD_H_
-#define SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_POLICY_FORWARD_H_
-
-#include "base/callback_forward.h"
-
-namespace playground2 {
-
-class Sandbox;
-class ErrorCode;
-typedef ErrorCode BpfSandboxPolicy(Sandbox* sandbox_compiler,
- int system_call_number,
- void* aux);
-
-typedef base::Callback<BpfSandboxPolicy> BpfSandboxPolicyCallback;
-
-} // namespace playground2
-
-#endif // SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_POLICY_FORWARD_H_