Removing uses of X11 native key events.
[chromium-blink-merge.git] / content / common / sandbox_linux / bpf_ppapi_policy_linux.cc
blob91b4c401d8f99918ac38f45786f2a17f31c27449
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/common/sandbox_linux/bpf_ppapi_policy_linux.h"
7 #include <errno.h>
9 #include "base/basictypes.h"
10 #include "build/build_config.h"
11 #include "content/common/sandbox_linux/sandbox_linux.h"
12 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h"
13 #include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h"
14 #include "sandbox/linux/services/linux_syscalls.h"
16 using sandbox::SyscallSets;
17 using sandbox::bpf_dsl::Allow;
18 using sandbox::bpf_dsl::Error;
19 using sandbox::bpf_dsl::ResultExpr;
21 namespace content {
23 PpapiProcessPolicy::PpapiProcessPolicy() {}
24 PpapiProcessPolicy::~PpapiProcessPolicy() {}
26 ResultExpr PpapiProcessPolicy::EvaluateSyscall(int sysno) const {
27 switch (sysno) {
28 // TODO(jln): restrict prctl.
29 case __NR_prctl:
30 case __NR_pread64:
31 case __NR_pwrite64:
32 case __NR_sched_get_priority_max:
33 case __NR_sched_get_priority_min:
34 case __NR_sched_getaffinity:
35 case __NR_sched_getparam:
36 case __NR_sched_getscheduler:
37 case __NR_sched_setscheduler:
38 case __NR_times:
39 return Allow();
40 case __NR_ioctl:
41 return Error(ENOTTY); // Flash Access.
42 default:
43 // Default on the baseline policy.
44 return SandboxBPFBasePolicy::EvaluateSyscall(sysno);
48 } // namespace content