OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ | 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ |
6 #define SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ | 6 #define SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ |
7 | 7 |
8 #include <linux/filter.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | |
11 #include <vector> | 10 #include <vector> |
12 | 11 |
| 12 #include "base/macros.h" |
| 13 |
| 14 struct sock_filter; |
| 15 |
13 namespace sandbox { | 16 namespace sandbox { |
14 | 17 struct arch_seccomp_data; |
| 18 class SandboxBPF; |
15 class SandboxBPFPolicy; | 19 class SandboxBPFPolicy; |
16 | 20 |
17 class Verifier { | 21 class Verifier { |
18 public: | 22 public: |
19 // Evaluate the BPF program for all possible inputs and verify that it | 23 // Evaluate the BPF program for all possible inputs and verify that it |
20 // computes the correct result. We use the "evaluators" to determine | 24 // computes the correct result. We use the "evaluators" to determine |
21 // the full set of possible inputs that we have to iterate over. | 25 // the full set of possible inputs that we have to iterate over. |
22 // Returns success, if the BPF filter accurately reflects the rules | 26 // Returns success, if the BPF filter accurately reflects the rules |
23 // set by the "evaluators". | 27 // set by the "evaluators". |
24 // Upon success, "err" is set to NULL. Upon failure, it contains a static | 28 // Upon success, "err" is set to NULL. Upon failure, it contains a static |
(...skipping 15 matching lines...) Expand all Loading... |
40 const struct arch_seccomp_data& data, | 44 const struct arch_seccomp_data& data, |
41 const char** err); | 45 const char** err); |
42 | 46 |
43 private: | 47 private: |
44 DISALLOW_IMPLICIT_CONSTRUCTORS(Verifier); | 48 DISALLOW_IMPLICIT_CONSTRUCTORS(Verifier); |
45 }; | 49 }; |
46 | 50 |
47 } // namespace sandbox | 51 } // namespace sandbox |
48 | 52 |
49 #endif // SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ | 53 #endif // SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ |
OLD | NEW |