OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_SANDBOX_BPF_BASE_POLICY_LINUX_H_ | 5 #ifndef CONTENT_COMMON_SANDBOX_BPF_BASE_POLICY_LINUX_H_ |
6 #define CONTENT_COMMON_SANDBOX_BPF_BASE_POLICY_LINUX_H_ | 6 #define CONTENT_COMMON_SANDBOX_BPF_BASE_POLICY_LINUX_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h" | 10 #include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h" |
11 #include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h" | 11 #include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h" |
12 | 12 |
13 using playground2::ErrorCode; | 13 using sandbox::ErrorCode; |
14 using playground2::Sandbox; | 14 using sandbox::SandboxBPF; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 // The "baseline" BPF policy for content/. Any content/ seccomp-bpf policy | 18 // The "baseline" BPF policy for content/. Any content/ seccomp-bpf policy |
19 // should inherit from it. | 19 // should inherit from it. |
20 // It implements the main SandboxBpfPolicy interface. Due to its nature | 20 // It implements the main SandboxBPFPolicy interface. Due to its nature |
21 // as a "kernel attack surface reduction" layer, it's implementation-defined. | 21 // as a "kernel attack surface reduction" layer, it's implementation-defined. |
22 class SandboxBpfBasePolicy : public playground2::SandboxBpfPolicy { | 22 class SandboxBPFBasePolicy : public sandbox::SandboxBPFPolicy { |
23 public: | 23 public: |
24 SandboxBpfBasePolicy(); | 24 SandboxBPFBasePolicy(); |
25 virtual ~SandboxBpfBasePolicy(); | 25 virtual ~SandboxBPFBasePolicy(); |
26 | 26 |
27 virtual ErrorCode EvaluateSyscall(Sandbox* sandbox_compiler, | 27 virtual ErrorCode EvaluateSyscall(SandboxBPF* sandbox_compiler, |
28 int system_call_number) const OVERRIDE; | 28 int system_call_number) const OVERRIDE; |
29 // Get the errno(3) to return for filesystem errors. | 29 // Get the errno(3) to return for filesystem errors. |
30 static int GetFSDeniedErrno(); | 30 static int GetFSDeniedErrno(); |
31 | 31 |
32 private: | 32 private: |
33 // Compose the BaselinePolicy from sandbox/. | 33 // Compose the BaselinePolicy from sandbox/. |
34 scoped_ptr<sandbox::BaselinePolicy> baseline_policy_; | 34 scoped_ptr<sandbox::BaselinePolicy> baseline_policy_; |
35 DISALLOW_COPY_AND_ASSIGN(SandboxBpfBasePolicy); | 35 DISALLOW_COPY_AND_ASSIGN(SandboxBPFBasePolicy); |
36 }; | 36 }; |
37 | 37 |
38 } // namespace content | 38 } // namespace content |
39 | 39 |
40 #endif // CONTENT_COMMON_SANDBOX_BPF_BASE_POLICY_LINUX_H_ | 40 #endif // CONTENT_COMMON_SANDBOX_BPF_BASE_POLICY_LINUX_H_ |
OLD | NEW |