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