Chromium Code Reviews| Index: content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc |
| diff --git a/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc |
| index de0a89f5ed9d16ac485cc356d215fe9ca61a3286..c679d236ff93ae2e7bcb7023caa8d03b7f6b12b7 100644 |
| --- a/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc |
| +++ b/content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc |
| @@ -48,7 +48,7 @@ inline bool IsChromeOS() { |
| } |
| inline bool IsArchitectureArm() { |
| -#if defined(__arm__) |
| +#if defined(__arm__) || defined(__aarch64__) |
| return true; |
| #else |
| return false; |
| @@ -108,8 +108,11 @@ class CrosArmGpuBrokerProcessPolicy : public CrosArmGpuProcessPolicy { |
| // openat allowed. |
| ResultExpr CrosArmGpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { |
| switch (sysno) { |
| +#if !defined(aarch64) |
|
jln (very slow on Chromium)
2014/12/08 19:09:24
You mean __aarch64__, no?
rickyz (no longer on Chrome)
2014/12/08 19:22:07
Would #if defined(__NR_access) and similar be more
cometzero
2014/12/09 17:38:42
Hmm. Looks good. To do that, however, we should ch
cometzero
2014/12/09 17:38:42
Oops. You're right. I'll fix it.
rickyz (no longer on Chrome)
2014/12/09 20:34:14
Sorry, I don't understand - does #if defined(__NR_
jln (very slow on Chromium)
2014/12/09 20:39:01
Yes, I think that's correct, it should work (we ha
rickyz (no longer on Chrome)
2014/12/09 20:43:33
Ah, I see, I had not fully grasped what you were s
|
| case __NR_access: |
| case __NR_open: |
| +#endif // !defined(aarch64) |
|
rickyz (no longer on Chrome)
2014/12/08 19:22:07
nit: 2 spaces before the // here and elsewhere
cometzero
2014/12/09 17:38:42
Thanks. I'll fix it.
|
| + case __NR_faccessat: |
| case __NR_openat: |
| return Allow(); |
| default: |
| @@ -125,13 +128,13 @@ CrosArmGpuProcessPolicy::CrosArmGpuProcessPolicy(bool allow_shmat) |
| CrosArmGpuProcessPolicy::~CrosArmGpuProcessPolicy() {} |
| ResultExpr CrosArmGpuProcessPolicy::EvaluateSyscall(int sysno) const { |
| -#if defined(__arm__) |
| +#if defined(__arm__) || defined(__aarch64__) |
|
rickyz (no longer on Chrome)
2014/12/08 19:22:07
Are any of these #ifs in this file actually needed
jln (very slow on Chromium)
2014/12/08 19:38:10
At some point we could consider doing that, but fo
cometzero
2014/12/09 17:38:42
I think arm and arm64 are using similar GPU like m
|
| if (allow_shmat_ && sysno == __NR_shmat) |
| return Allow(); |
| -#endif // defined(__arm__) |
| +#endif // defined(__arm__) || defined(__aarch64__) |
| switch (sysno) { |
| -#if defined(__arm__) |
| +#if defined(__arm__) || defined(__aarch64__) |
| // ARM GPU sandbox is started earlier so we need to allow networking |
| // in the sandbox. |
| case __NR_connect: |
| @@ -146,7 +149,7 @@ ResultExpr CrosArmGpuProcessPolicy::EvaluateSyscall(int sysno) const { |
| const Arg<int> domain(0); |
| return If(domain == AF_UNIX, Allow()).Else(Error(EPERM)); |
| } |
| -#endif // defined(__arm__) |
| +#endif // defined(__arm__) || defined(__aarch64__) |
| default: |
| // Default to the generic GPU policy. |
| return GpuProcessPolicy::EvaluateSyscall(sysno); |