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

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

Issue 10542028: Explicitly test bit 30 in the system call number to distinguish between the new x32 API and older I… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 6 months 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/sandbox_bpf.cc » ('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_BPF_H__ 5 #ifndef SANDBOX_BPF_H__
6 #define SANDBOX_BPF_H__ 6 #define 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #define SECCOMP_RET_ACTION 0xffff0000U // Masks for the return value 65 #define SECCOMP_RET_ACTION 0xffff0000U // Masks for the return value
66 #define SECCOMP_RET_DATA 0x0000ffffU // sections 66 #define SECCOMP_RET_DATA 0x0000ffffU // sections
67 #endif 67 #endif
68 #define SECCOMP_DENY_ERRNO EPERM 68 #define SECCOMP_DENY_ERRNO EPERM
69 #ifndef SYS_SECCOMP 69 #ifndef SYS_SECCOMP
70 #define SYS_SECCOMP 1 70 #define SYS_SECCOMP 1
71 #endif 71 #endif
72 72
73 #if defined(__i386__) 73 #if defined(__i386__)
74 #define MIN_SYSCALL 0 74 #define MIN_SYSCALL 0
75 #define MAX_SYSCALL 512 75 #define MAX_SYSCALL 1024
76 #define SECCOMP_ARCH AUDIT_ARCH_I386 76 #define SECCOMP_ARCH AUDIT_ARCH_I386
77 #define REG_RESULT REG_EAX 77 #define REG_RESULT REG_EAX
78 #define REG_SYSCALL REG_EAX 78 #define REG_SYSCALL REG_EAX
79 #define REG_PARM1 REG_EBX 79 #define REG_PARM1 REG_EBX
80 #define REG_PARM2 REG_ECX 80 #define REG_PARM2 REG_ECX
81 #define REG_PARM3 REG_EDX 81 #define REG_PARM3 REG_EDX
82 #define REG_PARM4 REG_ESI 82 #define REG_PARM4 REG_ESI
83 #define REG_PARM5 REG_EDI 83 #define REG_PARM5 REG_EDI
84 #define REG_PARM6 REG_EBP 84 #define REG_PARM6 REG_EBP
85 #elif defined(__x86_64__) 85 #elif defined(__x86_64__)
86 #define MIN_SYSCALL 0 86 #define MIN_SYSCALL 0
87 #define MAX_SYSCALL 512 87 #define MAX_SYSCALL 1024
88 #define SECCOMP_ARCH AUDIT_ARCH_X86_64 88 #define SECCOMP_ARCH AUDIT_ARCH_X86_64
89 #define REG_RESULT REG_RAX 89 #define REG_RESULT REG_RAX
90 #define REG_SYSCALL REG_RAX 90 #define REG_SYSCALL REG_RAX
91 #define REG_PARM1 REG_RDI 91 #define REG_PARM1 REG_RDI
92 #define REG_PARM2 REG_RSI 92 #define REG_PARM2 REG_RSI
93 #define REG_PARM3 REG_RDX 93 #define REG_PARM3 REG_RDX
94 #define REG_PARM4 REG_R10 94 #define REG_PARM4 REG_R10
95 #define REG_PARM5 REG_R8 95 #define REG_PARM5 REG_R8
96 #define REG_PARM6 REG_R9 96 #define REG_PARM6 REG_R9
97 #else 97 #else
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 static bool suppressLogging_; 235 static bool suppressLogging_;
236 static SandboxStatus status_; 236 static SandboxStatus status_;
237 static int proc_fd_; 237 static int proc_fd_;
238 static std::vector<std::pair<EvaluateSyscall, 238 static std::vector<std::pair<EvaluateSyscall,
239 EvaluateArguments> > evaluators_; 239 EvaluateArguments> > evaluators_;
240 }; 240 };
241 241
242 } // namespace 242 } // namespace
243 243
244 #endif // SANDBOX_BPF_H__ 244 #endif // SANDBOX_BPF_H__
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/sandbox_bpf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698