summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsesek <rsesek@chromium.org>2016-03-25 15:43:36 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 22:46:30 +0000
commitd4f9028b7caa77e2e034fa8fc728382d74a592ea (patch)
tree02db25c1a5383dee7c729d7674fbe27101fa9558
parentd4495227c6df738b6361994e984f84fa9adc802f (diff)
downloadchromium_src-d4f9028b7caa77e2e034fa8fc728382d74a592ea.zip
chromium_src-d4f9028b7caa77e2e034fa8fc728382d74a592ea.tar.gz
chromium_src-d4f9028b7caa77e2e034fa8fc728382d74a592ea.tar.bz2
[Android] Permit CLOCK_BOOTTIME for clock_gettime().
BUG=591884 R=mdempsky@chromium.org Review URL: https://codereview.chromium.org/1840483002 Cr-Commit-Position: refs/heads/master@{#383392}
-rw-r--r--sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc12
-rw-r--r--sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc3
2 files changed, 13 insertions, 2 deletions
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
index 57bffc0..98ac100 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
@@ -309,8 +309,16 @@ ResultExpr RestrictClockID() {
static_assert(4 == sizeof(clockid_t), "clockid_t is not 32bit");
const Arg<clockid_t> clockid(0);
return Switch(clockid)
- .CASES((CLOCK_MONOTONIC, CLOCK_MONOTONIC_COARSE, CLOCK_PROCESS_CPUTIME_ID,
- CLOCK_REALTIME, CLOCK_REALTIME_COARSE, CLOCK_THREAD_CPUTIME_ID),
+ .CASES((
+#if defined(OS_ANDROID)
+ CLOCK_BOOTTIME,
+#endif
+ CLOCK_MONOTONIC,
+ CLOCK_MONOTONIC_COARSE,
+ CLOCK_PROCESS_CPUTIME_ID,
+ CLOCK_REALTIME,
+ CLOCK_REALTIME_COARSE,
+ CLOCK_THREAD_CPUTIME_ID),
Allow())
.Default(CrashSIGSYS());
}
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
index 280211a..9daeedc 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
@@ -79,6 +79,9 @@ BPF_TEST_C(ParameterRestrictions,
CheckClock(CLOCK_MONOTONIC);
CheckClock(CLOCK_MONOTONIC_COARSE);
CheckClock(CLOCK_PROCESS_CPUTIME_ID);
+#if defined(OS_ANDROID)
+ CheckClock(CLOCK_BOOTTIME);
+#endif
CheckClock(CLOCK_REALTIME);
CheckClock(CLOCK_REALTIME_COARSE);
CheckClock(CLOCK_THREAD_CPUTIME_ID);