Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: sandbox/linux/seccomp-bpf/sandbox_bpf.h

Issue 11416326: SECCOMP-BPF: Fix SandboxSyscall() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Jeffrey's comments Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/syscall.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SANDBOX_BPF_H__ 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__
6 #define SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ 6 #define SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__
7 7
8 #include <endian.h> 8 #include <endian.h>
9 #include <errno.h> 9 #include <errno.h>
10 #include <fcntl.h> 10 #include <fcntl.h>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 #endif 159 #endif
160 160
161 #if defined(SECCOMP_BPF_STANDALONE) 161 #if defined(SECCOMP_BPF_STANDALONE)
162 #define arraysize(x) (sizeof(x)/sizeof(*(x))) 162 #define arraysize(x) (sizeof(x)/sizeof(*(x)))
163 #define HANDLE_EINTR TEMP_FAILURE_RETRY 163 #define HANDLE_EINTR TEMP_FAILURE_RETRY
164 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ 164 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
165 TypeName(); \ 165 TypeName(); \
166 TypeName(const TypeName&); \ 166 TypeName(const TypeName&); \
167 void operator=(const TypeName&) 167 void operator=(const TypeName&)
168
169 template <bool>
170 struct CompileAssert {
171 };
172 #define COMPILE_ASSERT(expr, msg) \
173 typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
168 #endif 174 #endif
169 175
170 #include "sandbox/linux/seccomp-bpf/die.h" 176 #include "sandbox/linux/seccomp-bpf/die.h"
171 #include "sandbox/linux/seccomp-bpf/errorcode.h" 177 #include "sandbox/linux/seccomp-bpf/errorcode.h"
172 178
173 namespace playground2 { 179 namespace playground2 {
174 180
175 struct arch_seccomp_data { 181 struct arch_seccomp_data {
176 int nr; 182 int nr;
177 uint32_t arch; 183 uint32_t arch;
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 static TrapIds trapIds_; 401 static TrapIds trapIds_;
396 static ErrorCode *trapArray_; 402 static ErrorCode *trapArray_;
397 static size_t trapArraySize_; 403 static size_t trapArraySize_;
398 static bool has_unsafe_traps_; 404 static bool has_unsafe_traps_;
399 DISALLOW_IMPLICIT_CONSTRUCTORS(Sandbox); 405 DISALLOW_IMPLICIT_CONSTRUCTORS(Sandbox);
400 }; 406 };
401 407
402 } // namespace 408 } // namespace
403 409
404 #endif // SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__ 410 #endif // SANDBOX_LINUX_SECCOMP_BPF_SANDBOX_BPF_H__
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/syscall.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698