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/net.h> | 10 #include <linux/net.h> |
11 #include <sched.h> | 11 #include <sched.h> |
12 #include <signal.h> | 12 #include <signal.h> |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 #include <sys/mman.h> | 14 #include <sys/mman.h> |
15 #include <sys/prctl.h> | 15 #include <sys/prctl.h> |
16 #include <sys/resource.h> | 16 #include <sys/resource.h> |
17 #include <sys/stat.h> | 17 #include <sys/stat.h> |
18 #include <sys/time.h> | 18 #include <sys/time.h> |
19 #include <sys/types.h> | 19 #include <sys/types.h> |
20 #include <time.h> | 20 #include <time.h> |
21 #include <unistd.h> | 21 #include <unistd.h> |
22 | 22 |
23 #include "base/logging.h" | 23 #include "base/logging.h" |
24 #include "base/macros.h" | 24 #include "base/macros.h" |
25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
rickyz (no longer on Chrome)
2015/10/29 21:05:02
Can this include be removed as well?
charliea (OOO until 10-5)
2015/10/29 21:16:37
Thanks for catching that! I was thinking that it c
| |
26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
27 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" | 27 #include "sandbox/linux/bpf_dsl/bpf_dsl.h" |
28 #include "sandbox/linux/bpf_dsl/seccomp_macros.h" | 28 #include "sandbox/linux/bpf_dsl/seccomp_macros.h" |
29 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | 29 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" |
30 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" | 30 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" |
31 #include "sandbox/linux/system_headers/linux_futex.h" | 31 #include "sandbox/linux/system_headers/linux_futex.h" |
32 #include "sandbox/linux/system_headers/linux_syscalls.h" | 32 #include "sandbox/linux/system_headers/linux_syscalls.h" |
33 #include "sandbox/linux/system_headers/linux_time.h" | 33 #include "sandbox/linux/system_headers/linux_time.h" |
34 | 34 |
35 // PNaCl toolchain does not provide sys/ioctl.h header. | 35 // PNaCl toolchain does not provide sys/ioctl.h header. |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 ResultExpr RestrictGetrusage() { | 296 ResultExpr RestrictGetrusage() { |
297 const Arg<int> who(0); | 297 const Arg<int> who(0); |
298 return If(who == RUSAGE_SELF, Allow()).Else(CrashSIGSYS()); | 298 return If(who == RUSAGE_SELF, Allow()).Else(CrashSIGSYS()); |
299 } | 299 } |
300 #endif // !defined(OS_NACL_NONSFI) | 300 #endif // !defined(OS_NACL_NONSFI) |
301 | 301 |
302 ResultExpr RestrictClockID() { | 302 ResultExpr RestrictClockID() { |
303 static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit"); | 303 static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit"); |
304 const Arg<clockid_t> clockid(0); | 304 const Arg<clockid_t> clockid(0); |
305 return If( | 305 return If( |
306 #if defined(OS_CHROMEOS) | |
307 // Allow the special clock for Chrome OS used by Chrome tracing. | |
308 clockid == base::TraceTicks::kClockSystemTrace || | |
309 #endif | |
310 clockid == CLOCK_MONOTONIC || | 306 clockid == CLOCK_MONOTONIC || |
311 clockid == CLOCK_MONOTONIC_COARSE || | 307 clockid == CLOCK_MONOTONIC_COARSE || |
312 clockid == CLOCK_PROCESS_CPUTIME_ID || | 308 clockid == CLOCK_PROCESS_CPUTIME_ID || |
313 clockid == CLOCK_REALTIME || | 309 clockid == CLOCK_REALTIME || |
314 clockid == CLOCK_REALTIME_COARSE || | 310 clockid == CLOCK_REALTIME_COARSE || |
315 clockid == CLOCK_THREAD_CPUTIME_ID, | 311 clockid == CLOCK_THREAD_CPUTIME_ID, |
316 Allow()).Else(CrashSIGSYS()); | 312 Allow()).Else(CrashSIGSYS()); |
317 } | 313 } |
318 | 314 |
319 } // namespace sandbox. | 315 } // namespace sandbox. |
OLD | NEW |