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

Unified Diff: components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_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, 6 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: components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc
diff --git a/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc b/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc
index 73adfd3503876be7af176e1189a684db574455e6..7999662e2ded7ce179b55abfb8f7dfe5f54597e0 100644
--- a/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc
+++ b/components/nacl/loader/sandbox_linux/nacl_bpf_sandbox_linux.cc
@@ -48,17 +48,17 @@ ErrorCode NaClBPFSandboxPolicy::EvaluateSyscall(
switch (sysno) {
// TODO(jln): NaCl's GDB debug stub uses the following socket system calls,
// see if it can be restricted a bit.
-#if defined(__x86_64__) || defined(__arm__)
+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
// transport_common.cc needs this.
case __NR_accept:
case __NR_setsockopt:
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__mips__)
case __NR_socketcall:
#endif
// trusted/service_runtime/linux/thread_suspension.c needs sigwait() and is
// used by NaCl's GDB debug stub.
case __NR_rt_sigtimedwait:
-#if defined(__i386__)
+#if defined(__i386__) || defined(__mips__)
// Needed on i386 to set-up the custom segments.
case __NR_modify_ldt:
#endif
@@ -67,7 +67,7 @@ ErrorCode NaClBPFSandboxPolicy::EvaluateSyscall(
// NaCl uses custom signal stacks.
case __NR_sigaltstack:
// Below is fairly similar to the policy for a Chromium renderer.
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
case __NR_getrlimit:
#endif
#if defined(__i386__) || defined(__arm__)
@@ -117,9 +117,7 @@ void RunSandboxSanityChecks() {
#else
-#if !defined(ARCH_CPU_MIPS_FAMILY)
#error "Seccomp-bpf disabled on supported architecture!"
-#endif
#endif // defined(USE_SECCOMP_BPF)

Powered by Google App Engine
This is Rietveld 408576698