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

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" 5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <linux/futex.h> 10 #include <linux/futex.h>
11 #include <linux/net.h> 11 #include <linux/net.h>
12 #include <sched.h> 12 #include <sched.h>
13 #include <signal.h> 13 #include <signal.h>
14 #include <sys/ioctl.h> 14 #include <sys/ioctl.h>
15 #include <sys/mman.h> 15 #include <sys/mman.h>
16 #include <sys/prctl.h> 16 #include <sys/prctl.h>
17 #include <sys/resource.h> 17 #include <sys/resource.h>
18 #include <sys/stat.h> 18 #include <sys/stat.h>
19 #include <sys/time.h> 19 #include <sys/time.h>
20 #include <sys/types.h> 20 #include <sys/types.h>
21 #include <time.h> 21 #include <time.h>
22 #include <unistd.h> 22 #include <unistd.h>
23 23
24 #include "base/basictypes.h" 24 #include "base/basictypes.h"
25 #include "base/logging.h" 25 #include "base/logging.h"
26 #include "base/macros.h" 26 #include "base/macros.h"
27 #include "base/time/time.h" 27 #include "base/time/time.h"
28 #include "build/build_config.h" 28 #include "build/build_config.h"
29 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" 29 #include "sandbox/linux/bpf_dsl/bpf_dsl.h"
30 #include "sandbox/linux/bpf_dsl/seccomp_macros.h"
30 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" 31 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
31 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
32 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" 32 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
33 #include "sandbox/linux/services/linux_syscalls.h" 33 #include "sandbox/linux/system_headers/linux_syscalls.h"
34 34
35 #if defined(OS_ANDROID) 35 #if defined(OS_ANDROID)
36 36
37 #include "sandbox/linux/services/android_futex.h" 37 #include "sandbox/linux/system_headers/android_futex.h"
38 38
39 #if !defined(F_DUPFD_CLOEXEC) 39 #if !defined(F_DUPFD_CLOEXEC)
40 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6) 40 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
41 #endif 41 #endif
42 42
43 // https://android.googlesource.com/platform/bionic/+/lollipop-release/libc/priv ate/bionic_prctl.h 43 // https://android.googlesource.com/platform/bionic/+/lollipop-release/libc/priv ate/bionic_prctl.h
44 #if !defined(PR_SET_VMA) 44 #if !defined(PR_SET_VMA)
45 #define PR_SET_VMA 0x53564d41 45 #define PR_SET_VMA 0x53564d41
46 #endif 46 #endif
47 47
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 const Arg<pid_t> pid(0); 303 const Arg<pid_t> pid(0);
304 return If(pid == 0 || pid == target_pid, Allow()).Else(CrashSIGSYS()); 304 return If(pid == 0 || pid == target_pid, Allow()).Else(CrashSIGSYS());
305 } 305 }
306 306
307 ResultExpr RestrictGetrusage() { 307 ResultExpr RestrictGetrusage() {
308 const Arg<int> who(0); 308 const Arg<int> who(0);
309 return If(who == RUSAGE_SELF, Allow()).Else(CrashSIGSYS()); 309 return If(who == RUSAGE_SELF, Allow()).Else(CrashSIGSYS());
310 } 310 }
311 311
312 } // namespace sandbox. 312 } // namespace sandbox.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698