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

Unified Diff: sandbox/linux/seccomp-bpf-helpers/baseline_policy.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: sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
index a9fb1044778dd8ab28424bbc8afe1b2191b9f921..7a6c057ac1dc5073532ae583e57e90d1731ee7bb 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -43,6 +43,9 @@ bool IsBaselinePolicyAllowed(int sysno) {
#if defined(__arm__)
SyscallSets::IsArmPrivate(sysno) ||
#endif
+#if defined(__mips__)
+ SyscallSets::IsMipsPrivate(sysno) ||
+#endif
SyscallSets::IsAllowedOperationOnFd(sysno);
}
@@ -72,12 +75,15 @@ bool IsBaselinePolicyWatched(int sysno) {
SyscallSets::IsNuma(sysno) ||
SyscallSets::IsPrctl(sysno) ||
SyscallSets::IsProcessGroupOrSession(sysno) ||
-#if defined(__i386__)
+#if defined(__i386__) || defined(__mips__)
SyscallSets::IsSocketCall(sysno) ||
#endif
#if defined(__arm__)
SyscallSets::IsArmPciConfig(sysno) ||
#endif
+#if defined(__mips__)
+ SyscallSets::IsMipsMisc(sysno) ||
+#endif
SyscallSets::IsTimer(sysno);
}
@@ -116,7 +122,7 @@ ErrorCode EvaluateSyscallImpl(int fs_denied_errno,
if (sysno == __NR_fcntl)
return RestrictFcntlCommands(sandbox);
-#if defined(__i386__) || defined(__arm__)
+#if defined(__i386__) || defined(__arm__) || defined(__mips__)
if (sysno == __NR_fcntl64)
return RestrictFcntlCommands(sandbox);
#endif
@@ -132,12 +138,12 @@ ErrorCode EvaluateSyscallImpl(int fs_denied_errno,
ErrorCode(EPERM));
}
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
if (sysno == __NR_mmap)
return RestrictMmapFlags(sandbox);
#endif
-#if defined(__i386__) || defined(__arm__)
+#if defined(__i386__) || defined(__arm__) || defined(__mips__)
if (sysno == __NR_mmap2)
return RestrictMmapFlags(sandbox);
#endif
@@ -148,7 +154,7 @@ ErrorCode EvaluateSyscallImpl(int fs_denied_errno,
if (sysno == __NR_prctl)
return sandbox::RestrictPrctl(sandbox);
-#if defined(__x86_64__) || defined(__arm__)
+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
if (sysno == __NR_socketpair) {
// Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
COMPILE_ASSERT(AF_UNIX == PF_UNIX, af_unix_pf_unix_different);
@@ -178,7 +184,7 @@ ErrorCode EvaluateSyscallImpl(int fs_denied_errno,
return ErrorCode(EPERM);
}
-#if defined(__i386__)
+#if defined(__i386__) || defined(__mips__)
if (SyscallSets::IsSocketCall(sysno))
return RestrictSocketcallCommand(sandbox);
#endif

Powered by Google App Engine
This is Rietveld 408576698