Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: content/common/sandbox_linux/bpf_cros_arm_gpu_policy_linux.cc

Issue 784733002: content: bpf: exclude the syscalls if arm64 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content: bpf: exclude the syscalls if arm64 Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | content/common/sandbox_linux/bpf_gpu_policy_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d215533b477362104ecd3da5c5151d3f6405c585 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__)
case __NR_access:
case __NR_open:
+#endif // !defined(__aarch64__)
+ 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__)
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);
« no previous file with comments | « AUTHORS ('k') | content/common/sandbox_linux/bpf_gpu_policy_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698