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

Unified Diff: content/common/sandbox_linux/bpf_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: 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
Index: content/common/sandbox_linux/bpf_gpu_policy_linux.cc
diff --git a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
index 711f9b4a552b23ed22d4a4060ad89bbf7b0ab6ee..d941a31518af9cc9424259423f02b1a563da793b 100644
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
@@ -94,6 +94,7 @@ intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args,
BrokerProcess* broker_process =
static_cast<BrokerProcess*>(aux_broker_process);
switch (args.nr) {
+#if !defined(__aarch64__)
case __NR_access:
return broker_process->Access(reinterpret_cast<const char*>(args.args[0]),
static_cast<int>(args.args[1]));
@@ -104,6 +105,15 @@ intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args,
#endif
return broker_process->Open(reinterpret_cast<const char*>(args.args[0]),
static_cast<int>(args.args[1]));
+#endif // !defined(__aarch64__)
+ case __NR_faccessat:
+ if (static_cast<int>(args.args[0]) == AT_FDCWD) {
+ return
+ broker_process->Access(reinterpret_cast<const char*>(args.args[1]),
+ static_cast<int>(args.args[2]));
+ } else {
+ return -EPERM;
+ }
case __NR_openat:
// Allow using openat() as open().
if (static_cast<int>(args.args[0]) == AT_FDCWD) {
@@ -138,8 +148,11 @@ class GpuBrokerProcessPolicy : public GpuProcessPolicy {
// openat allowed.
ResultExpr GpuBrokerProcessPolicy::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:
@@ -203,8 +216,11 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const {
// TODO(jln): restrict prctl.
case __NR_prctl:
return Allow();
+#if !defined(__aarch64__)
case __NR_access:
case __NR_open:
+#endif // !defined(__aarch64__)
+ case __NR_faccessat:
case __NR_openat:
DCHECK(broker_process_);
return Trap(GpuSIGSYS_Handler, broker_process_);

Powered by Google App Engine
This is Rietveld 408576698