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

Side by Side Diff: sandbox/linux/bpf_dsl/seccomp_macros.h

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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
« no previous file with comments | « sandbox/linux/bpf_dsl/policy_compiler.cc ('k') | sandbox/linux/bpf_dsl/trap_registry.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_BPF_DSL_SECCOMP_MACROS_H_ 5 #ifndef SANDBOX_LINUX_BPF_DSL_SECCOMP_MACROS_H_
6 #define SANDBOX_LINUX_BPF_DSL_SECCOMP_MACROS_H_ 6 #define SANDBOX_LINUX_BPF_DSL_SECCOMP_MACROS_H_
7 7
8 #include <asm/unistd.h> 8 #include <asm/unistd.h>
9 #include <linux/filter.h> 9 #include <linux/filter.h>
10 10
11 #include <sys/cdefs.h> 11 #include <sys/cdefs.h>
12 // Old Bionic versions do not have sys/user.h. The if can be removed once we no 12 // Old Bionic versions do not have sys/user.h. The if can be removed once we no
13 // longer need to support these old Bionic versions. 13 // longer need to support these old Bionic versions.
14 // All x86_64 builds use a new enough bionic to have sys/user.h. 14 // All x86_64 builds use a new enough bionic to have sys/user.h.
15 #if !defined(__BIONIC__) || defined(__x86_64__) 15 #if !defined(__BIONIC__) || defined(__x86_64__)
16 #include <sys/types.h> // Fix for gcc 4.7, make sure __uint16_t is defined. 16 #include <sys/types.h> // Fix for gcc 4.7, make sure __uint16_t is defined.
17 #include <sys/user.h> 17 #include <sys/user.h>
18 #if defined(__mips__) 18 #if defined(__mips__)
19 // sys/user.h in eglibc misses size_t definition 19 // sys/user.h in eglibc misses size_t definition
20 #include <stddef.h> 20 #include <stddef.h>
21 #endif 21 #endif
22 #endif 22 #endif
23 23
24 #include "sandbox/linux/system_headers/linux_seccomp.h" // For AUDIT_ARCH_*
25
24 // Impose some reasonable maximum BPF program size. Realistically, the 26 // Impose some reasonable maximum BPF program size. Realistically, the
25 // kernel probably has much lower limits. But by limiting to less than 27 // kernel probably has much lower limits. But by limiting to less than
26 // 30 bits, we can ease requirements on some of our data types. 28 // 30 bits, we can ease requirements on some of our data types.
27 #define SECCOMP_MAX_PROGRAM_SIZE (1<<30) 29 #define SECCOMP_MAX_PROGRAM_SIZE (1<<30)
28 30
29 #if defined(__i386__) 31 #if defined(__i386__)
30 #define SECCOMP_ARCH AUDIT_ARCH_I386 32 #define SECCOMP_ARCH AUDIT_ARCH_I386
31 33
32 #define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.gregs[(_reg)]) 34 #define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.gregs[(_reg)])
33 #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, REG_EAX) 35 #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, REG_EAX)
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 #define SECCOMP_PT_PARM3(_regs) (_regs).regs[2] 287 #define SECCOMP_PT_PARM3(_regs) (_regs).regs[2]
286 #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3] 288 #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
287 #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4] 289 #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
288 #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5] 290 #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
289 #else 291 #else
290 #error Unsupported target platform 292 #error Unsupported target platform
291 293
292 #endif 294 #endif
293 295
294 #endif // SANDBOX_LINUX_BPF_DSL_SECCOMP_MACROS_H_ 296 #endif // SANDBOX_LINUX_BPF_DSL_SECCOMP_MACROS_H_
OLDNEW
« no previous file with comments | « sandbox/linux/bpf_dsl/policy_compiler.cc ('k') | sandbox/linux/bpf_dsl/trap_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698