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

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

Issue 260793003: [MIPS] Add seccomp bpf support (Closed) Base URL: https://git.chromium.org/git/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 8 months 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 1570114c012ac4dc5ddd563c6a4286ba5e6b1f82..5bc202a35d320dd82501562fc04a3d136da30d99 100644
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
@@ -96,11 +96,21 @@ intptr_t GpuSIGSYS_Handler(const struct arch_seccomp_data& args,
broker_process->Open(reinterpret_cast<const char*>(args.args[1]),
static_cast<int>(args.args[2]));
} else {
+#if defined(__mips__)
+ // On MIPS, kernel returns errno (instead of -errno)
+ return EPERM;
jln (very slow on Chromium) 2014/05/02 20:42:04 Ohh, this is very unfortunate :( Let's add a help
nedeljko 2014/05/07 15:40:05 Helper added. I created RetValToKernel instead of
+#else
return -EPERM;
+#endif
}
default:
RAW_CHECK(false);
+#if defined(__mips__)
+ // On MIPS, kernel returns errno (instead of -errno)
+ return ENOSYS;
+#else
return -ENOSYS;
+#endif
}
}
@@ -167,7 +177,7 @@ ErrorCode GpuProcessPolicy::EvaluateSyscall(SandboxBPF* sandbox,
int sysno) const {
switch (sysno) {
case __NR_ioctl:
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
// The Nvidia driver uses flags not in the baseline policy
// (MAP_LOCKED | MAP_EXECUTABLE | MAP_32BIT)
case __NR_mmap:

Powered by Google App Engine
This is Rietveld 408576698