OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "sandbox/linux/bpf_dsl/bpf_dsl.h" | 5 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" |
6 | 6 |
7 #include <errno.h> | |
8 | |
9 #include <limits> | 7 #include <limits> |
10 | 8 |
11 #include "base/logging.h" | 9 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
13 #include "sandbox/linux/bpf_dsl/bpf_dsl_impl.h" | 11 #include "sandbox/linux/bpf_dsl/bpf_dsl_impl.h" |
14 #include "sandbox/linux/bpf_dsl/policy_compiler.h" | 12 #include "sandbox/linux/bpf_dsl/policy_compiler.h" |
15 #include "sandbox/linux/seccomp-bpf/errorcode.h" | 13 #include "sandbox/linux/seccomp-bpf/errorcode.h" |
16 | 14 |
17 namespace sandbox { | 15 namespace sandbox { |
18 namespace bpf_dsl { | 16 namespace bpf_dsl { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // and end up with an appropriately chained tree. | 363 // and end up with an appropriately chained tree. |
366 | 364 |
367 ResultExpr expr = else_result; | 365 ResultExpr expr = else_result; |
368 for (const Clause& clause : clause_list_) { | 366 for (const Clause& clause : clause_list_) { |
369 expr = ResultExpr( | 367 expr = ResultExpr( |
370 new const IfThenResultExprImpl(clause.first, clause.second, expr)); | 368 new const IfThenResultExprImpl(clause.first, clause.second, expr)); |
371 } | 369 } |
372 return expr; | 370 return expr; |
373 } | 371 } |
374 | 372 |
375 ResultExpr SandboxBPFDSLPolicy::InvalidSyscall() const { | |
376 return Error(ENOSYS); | |
377 } | |
378 | |
379 ResultExpr SandboxBPFDSLPolicy::Trap(TrapRegistry::TrapFnc trap_func, | |
380 const void* aux) { | |
381 return bpf_dsl::Trap(trap_func, aux); | |
382 } | |
383 | |
384 } // namespace bpf_dsl | 373 } // namespace bpf_dsl |
385 } // namespace sandbox | 374 } // namespace sandbox |
386 | 375 |
387 template class scoped_refptr<const sandbox::bpf_dsl::internal::BoolExprImpl>; | 376 template class scoped_refptr<const sandbox::bpf_dsl::internal::BoolExprImpl>; |
388 template class scoped_refptr<const sandbox::bpf_dsl::internal::ResultExprImpl>; | 377 template class scoped_refptr<const sandbox::bpf_dsl::internal::ResultExprImpl>; |
OLD | NEW |