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

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

Issue 101773003: Linux sandbox: cleanup sandbox-bpf naming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits. Created 7 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
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_SYSCALL_H__ 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__
6 #define SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__ 6 #define SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 namespace playground2 { 10 namespace sandbox {
11 11
12 // We have to make sure that we have a single "magic" return address for 12 // We have to make sure that we have a single "magic" return address for
13 // our system calls, which we can check from within a BPF filter. This 13 // our system calls, which we can check from within a BPF filter. This
14 // works by writing a little bit of asm() code that a) enters the kernel, and 14 // works by writing a little bit of asm() code that a) enters the kernel, and
15 // that also b) can be invoked in a way that computes this return address. 15 // that also b) can be invoked in a way that computes this return address.
16 // Passing "nr" as "-1" computes the "magic" return address. Passing any 16 // Passing "nr" as "-1" computes the "magic" return address. Passing any
17 // other value invokes the appropriate system call. 17 // other value invokes the appropriate system call.
18 intptr_t SandboxSyscall(int nr, 18 intptr_t SandboxSyscall(int nr,
19 intptr_t p0, 19 intptr_t p0,
20 intptr_t p1, 20 intptr_t p1,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return SandboxSyscall(nr, p0, 0, 0, 0, 0, 0); 126 return SandboxSyscall(nr, p0, 0, 0, 0, 0, 0);
127 } 127 }
128 128
129 inline intptr_t SandboxSyscall(int nr) __attribute__((always_inline)); 129 inline intptr_t SandboxSyscall(int nr) __attribute__((always_inline));
130 inline intptr_t SandboxSyscall(int nr) { 130 inline intptr_t SandboxSyscall(int nr) {
131 return SandboxSyscall(nr, 0, 0, 0, 0, 0, 0); 131 return SandboxSyscall(nr, 0, 0, 0, 0, 0, 0);
132 } 132 }
133 133
134 #endif // Pre-C++11 134 #endif // Pre-C++11
135 135
136 } // namespace 136 } // namespace
Robert Sesek 2013/12/10 21:15:26 "namespace sandbox"
jln (very slow on Chromium) 2013/12/10 21:36:38 Done.
137 137
138 #endif // SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__ 138 #endif // SANDBOX_LINUX_SECCOMP_BPF_SYSCALL_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698