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

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: Update per code review Created 6 years, 7 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 e54cb210909d11b6ec2ee8cc3a3cbbe8564d4de8..28290888ffb5656c2eb40d04098fade66d1fd3f5 100644
--- a/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
+++ b/content/common/sandbox_linux/bpf_gpu_policy_linux.cc
@@ -26,6 +26,7 @@
#include "content/common/set_process_title.h"
#include "content/public/common/content_switches.h"
#include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h"
+#include "sandbox/linux/seccomp-bpf/kernel_return_value_helpers.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
#include "sandbox/linux/services/broker_process.h"
#include "sandbox/linux/services/linux_syscalls.h"
@@ -100,11 +101,11 @@ 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 {
- return -EPERM;
+ return sandbox::ErrnoToKernelRet(EPERM);
jln (very slow on Chromium) 2014/06/13 02:47:36 Let's just declare that trap handlers have the sam
nedeljko 2014/06/18 13:41:00 Done.
}
default:
RAW_CHECK(false);
- return -ENOSYS;
+ return sandbox::ErrnoToKernelRet(ENOSYS);
}
}
@@ -171,7 +172,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