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 <linux/filter.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const std::vector<struct sock_filter>& program; | 53 const std::vector<struct sock_filter>& program; |
54 const struct arch_seccomp_data& data; | 54 const struct arch_seccomp_data& data; |
55 unsigned int ip; | 55 unsigned int ip; |
56 uint32_t accumulator; | 56 uint32_t accumulator; |
57 bool acc_is_valid; | 57 bool acc_is_valid; |
58 | 58 |
59 private: | 59 private: |
60 DISALLOW_IMPLICIT_CONSTRUCTORS(State); | 60 DISALLOW_IMPLICIT_CONSTRUCTORS(State); |
61 }; | 61 }; |
62 | 62 |
| 63 static bool VerifyErrorCode(const std::vector<struct sock_filter>& prg, |
| 64 struct arch_seccomp_data *data, |
| 65 const ErrorCode& code, const char **err); |
63 static void Ld (State *state, const struct sock_filter& insn, | 66 static void Ld (State *state, const struct sock_filter& insn, |
64 const char **err); | 67 const char **err); |
65 static void Jmp(State *state, const struct sock_filter& insn, | 68 static void Jmp(State *state, const struct sock_filter& insn, |
66 const char **err); | 69 const char **err); |
67 static uint32_t Ret(State *state, const struct sock_filter& insn, | 70 static uint32_t Ret(State *state, const struct sock_filter& insn, |
68 const char **err); | 71 const char **err); |
69 | 72 |
70 DISALLOW_IMPLICIT_CONSTRUCTORS(Verifier); | 73 DISALLOW_IMPLICIT_CONSTRUCTORS(Verifier); |
71 }; | 74 }; |
72 | 75 |
73 } // namespace | 76 } // namespace |
74 | 77 |
75 #endif // SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ | 78 #endif // SANDBOX_LINUX_SECCOMP_BPF_VERIFIER_H__ |
OLD | NEW |