| 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 "content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 AddArmMaliGpuWhitelist(read_whitelist, write_whitelist); | 94 AddArmMaliGpuWhitelist(read_whitelist, write_whitelist); |
| 95 } | 95 } |
| 96 | 96 |
| 97 class CrosArmGpuBrokerProcessPolicy : public CrosArmGpuProcessPolicy { | 97 class CrosArmGpuBrokerProcessPolicy : public CrosArmGpuProcessPolicy { |
| 98 public: | 98 public: |
| 99 static sandbox::bpf_dsl::SandboxBPFDSLPolicy* Create() { | 99 static sandbox::bpf_dsl::SandboxBPFDSLPolicy* Create() { |
| 100 return new CrosArmGpuBrokerProcessPolicy(); | 100 return new CrosArmGpuBrokerProcessPolicy(); |
| 101 } | 101 } |
| 102 virtual ~CrosArmGpuBrokerProcessPolicy() {} | 102 virtual ~CrosArmGpuBrokerProcessPolicy() {} |
| 103 | 103 |
| 104 virtual ResultExpr EvaluateSyscall(int system_call_number) const OVERRIDE; | 104 virtual ResultExpr EvaluateSyscall(int system_call_number) const override; |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 CrosArmGpuBrokerProcessPolicy() : CrosArmGpuProcessPolicy(false) {} | 107 CrosArmGpuBrokerProcessPolicy() : CrosArmGpuProcessPolicy(false) {} |
| 108 DISALLOW_COPY_AND_ASSIGN(CrosArmGpuBrokerProcessPolicy); | 108 DISALLOW_COPY_AND_ASSIGN(CrosArmGpuBrokerProcessPolicy); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 // A GPU broker policy is the same as a GPU policy with open and | 111 // A GPU broker policy is the same as a GPU policy with open and |
| 112 // openat allowed. | 112 // openat allowed. |
| 113 ResultExpr CrosArmGpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { | 113 ResultExpr CrosArmGpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { |
| 114 switch (sysno) { | 114 switch (sysno) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // Preload the Tegra V4L2 (video decode acceleration) library. | 181 // Preload the Tegra V4L2 (video decode acceleration) library. |
| 182 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); | 182 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); |
| 183 // Resetting errno since platform-specific libraries will fail on other | 183 // Resetting errno since platform-specific libraries will fail on other |
| 184 // platforms. | 184 // platforms. |
| 185 errno = 0; | 185 errno = 0; |
| 186 | 186 |
| 187 return true; | 187 return true; |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace content | 190 } // namespace content |
| OLD | NEW |