| 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 #include "components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.h" | 5 #include "components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(USE_SECCOMP_BPF) | 9 #if defined(USE_SECCOMP_BPF) |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 using sandbox::bpf_dsl::Allow; | 32 using sandbox::bpf_dsl::Allow; |
| 33 using sandbox::bpf_dsl::Error; | 33 using sandbox::bpf_dsl::Error; |
| 34 using sandbox::bpf_dsl::ResultExpr; | 34 using sandbox::bpf_dsl::ResultExpr; |
| 35 | 35 |
| 36 class NaClBPFSandboxPolicy : public sandbox::bpf_dsl::SandboxBPFDSLPolicy { | 36 class NaClBPFSandboxPolicy : public sandbox::bpf_dsl::SandboxBPFDSLPolicy { |
| 37 public: | 37 public: |
| 38 NaClBPFSandboxPolicy() | 38 NaClBPFSandboxPolicy() |
| 39 : baseline_policy_(content::GetBPFSandboxBaselinePolicy()) {} | 39 : baseline_policy_(content::GetBPFSandboxBaselinePolicy()) {} |
| 40 virtual ~NaClBPFSandboxPolicy() {} | 40 virtual ~NaClBPFSandboxPolicy() {} |
| 41 | 41 |
| 42 virtual ResultExpr EvaluateSyscall(int system_call_number) const OVERRIDE; | 42 virtual ResultExpr EvaluateSyscall(int system_call_number) const override; |
| 43 virtual ResultExpr InvalidSyscall() const OVERRIDE { | 43 virtual ResultExpr InvalidSyscall() const override { |
| 44 return baseline_policy_->InvalidSyscall(); | 44 return baseline_policy_->InvalidSyscall(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 scoped_ptr<sandbox::bpf_dsl::SandboxBPFDSLPolicy> baseline_policy_; | 48 scoped_ptr<sandbox::bpf_dsl::SandboxBPFDSLPolicy> baseline_policy_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(NaClBPFSandboxPolicy); | 50 DISALLOW_COPY_AND_ASSIGN(NaClBPFSandboxPolicy); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 ResultExpr NaClBPFSandboxPolicy::EvaluateSyscall(int sysno) const { | 53 ResultExpr NaClBPFSandboxPolicy::EvaluateSyscall(int sysno) const { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 new NaClBPFSandboxPolicy)); | 134 new NaClBPFSandboxPolicy)); |
| 135 if (sandbox_is_initialized) { | 135 if (sandbox_is_initialized) { |
| 136 RunSandboxSanityChecks(); | 136 RunSandboxSanityChecks(); |
| 137 return true; | 137 return true; |
| 138 } | 138 } |
| 139 #endif // defined(USE_SECCOMP_BPF) | 139 #endif // defined(USE_SECCOMP_BPF) |
| 140 return false; | 140 return false; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace nacl | 143 } // namespace nacl |
| OLD | NEW |