Chromium Code Reviews| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 CrosArmGpuBrokerProcessPolicy() : CrosArmGpuProcessPolicy(false) {} | 103 CrosArmGpuBrokerProcessPolicy() : CrosArmGpuProcessPolicy(false) {} |
| 104 DISALLOW_COPY_AND_ASSIGN(CrosArmGpuBrokerProcessPolicy); | 104 DISALLOW_COPY_AND_ASSIGN(CrosArmGpuBrokerProcessPolicy); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 // A GPU broker policy is the same as a GPU policy with open and | 107 // A GPU broker policy is the same as a GPU policy with open and |
| 108 // openat allowed. | 108 // openat allowed. |
| 109 ResultExpr CrosArmGpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { | 109 ResultExpr CrosArmGpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { |
| 110 switch (sysno) { | 110 switch (sysno) { |
| 111 #if !defined(aarch64) | |
| 111 case __NR_access: | 112 case __NR_access: |
|
mdempsky
2014/12/07 03:46:40
Do we need to allow __NR_accessat or something els
cometzero
2014/12/07 06:47:38
Hmm. There is no __NR_access on the arm64. Maybe _
leecam
2014/12/07 17:08:24
Yep __NR_faccessat is the replacement for __NR_acc
| |
| 112 case __NR_open: | 113 case __NR_open: |
| 114 #endif // !defined(aarch64) | |
| 113 case __NR_openat: | 115 case __NR_openat: |
| 114 return Allow(); | 116 return Allow(); |
| 115 default: | 117 default: |
| 116 return CrosArmGpuProcessPolicy::EvaluateSyscall(sysno); | 118 return CrosArmGpuProcessPolicy::EvaluateSyscall(sysno); |
| 117 } | 119 } |
| 118 } | 120 } |
| 119 | 121 |
| 120 } // namespace | 122 } // namespace |
| 121 | 123 |
| 122 CrosArmGpuProcessPolicy::CrosArmGpuProcessPolicy(bool allow_shmat) | 124 CrosArmGpuProcessPolicy::CrosArmGpuProcessPolicy(bool allow_shmat) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 // Preload the Tegra V4L2 (video decode acceleration) library. | 173 // Preload the Tegra V4L2 (video decode acceleration) library. |
| 172 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); | 174 dlopen("/usr/lib/libtegrav4l2.so", dlopen_flag); |
| 173 // Resetting errno since platform-specific libraries will fail on other | 175 // Resetting errno since platform-specific libraries will fail on other |
| 174 // platforms. | 176 // platforms. |
| 175 errno = 0; | 177 errno = 0; |
| 176 | 178 |
| 177 return true; | 179 return true; |
| 178 } | 180 } |
| 179 | 181 |
| 180 } // namespace content | 182 } // namespace content |
| OLD | NEW |