| OLD | NEW |
| 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 <stdint.h> |
| 14 #include <sys/ioctl.h> | 15 #include <sys/ioctl.h> |
| 15 #include <sys/mman.h> | 16 #include <sys/mman.h> |
| 16 #include <sys/prctl.h> | 17 #include <sys/prctl.h> |
| 17 #include <sys/resource.h> | 18 #include <sys/resource.h> |
| 18 #include <sys/stat.h> | 19 #include <sys/stat.h> |
| 19 #include <sys/time.h> | 20 #include <sys/time.h> |
| 20 #include <sys/types.h> | 21 #include <sys/types.h> |
| 21 #include <time.h> | 22 #include <time.h> |
| 22 #include <unistd.h> | 23 #include <unistd.h> |
| 23 | 24 |
| 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/bpf_dsl/seccomp_macros.h" |
| 31 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | 31 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" |
| 32 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 32 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
| 33 #include "sandbox/linux/system_headers/linux_syscalls.h" | 33 #include "sandbox/linux/system_headers/linux_syscalls.h" |
| 34 | 34 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| OLD | NEW |