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

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

Issue 1133653002: Allow coarse clocks in clock_get{res,time} calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow coarse clocks in clock_get{res,time} calls, v7 Created 5 years, 7 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/net.h> 10 #include <linux/net.h>
(...skipping 12 matching lines...) Expand all
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"
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 34
34 // PNaCl toolchain does not provide sys/ioctl.h header. 35 // PNaCl toolchain does not provide sys/ioctl.h header.
35 #if !defined(OS_NACL_NONSFI) 36 #if !defined(OS_NACL_NONSFI)
36 #include <sys/ioctl.h> 37 #include <sys/ioctl.h>
37 #endif 38 #endif
38 39
39 #if defined(OS_ANDROID) 40 #if defined(OS_ANDROID)
40 41
41 #if !defined(F_DUPFD_CLOEXEC) 42 #if !defined(F_DUPFD_CLOEXEC)
42 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6) 43 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 301
301 ResultExpr RestrictClockID() { 302 ResultExpr RestrictClockID() {
302 static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit"); 303 static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit");
303 const Arg<clockid_t> clockid(0); 304 const Arg<clockid_t> clockid(0);
304 return If( 305 return If(
305 #if defined(OS_CHROMEOS) 306 #if defined(OS_CHROMEOS)
306 // Allow the special clock for Chrome OS used by Chrome tracing. 307 // Allow the special clock for Chrome OS used by Chrome tracing.
307 clockid == base::TimeTicks::kClockSystemTrace || 308 clockid == base::TimeTicks::kClockSystemTrace ||
308 #endif 309 #endif
309 clockid == CLOCK_MONOTONIC || 310 clockid == CLOCK_MONOTONIC ||
311 clockid == CLOCK_MONOTONIC_COARSE ||
310 clockid == CLOCK_PROCESS_CPUTIME_ID || 312 clockid == CLOCK_PROCESS_CPUTIME_ID ||
311 clockid == CLOCK_REALTIME || 313 clockid == CLOCK_REALTIME ||
314 clockid == CLOCK_REALTIME_COARSE ||
312 clockid == CLOCK_THREAD_CPUTIME_ID, 315 clockid == CLOCK_THREAD_CPUTIME_ID,
313 Allow()).Else(CrashSIGSYS()); 316 Allow()).Else(CrashSIGSYS());
314 } 317 }
315 318
316 } // namespace sandbox. 319 } // namespace sandbox.
OLDNEW
« no previous file with comments | « sandbox/linux/sandbox_linux.gypi ('k') | sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698