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

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, 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: 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 3380cc851e09052da1236eae00422f710918d180..693367bcabb8a59fb7c8e9f08d81e406a6336237 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -44,6 +44,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) {
#endif
SyscallSets::IsNuma(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
@@ -129,12 +135,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
@@ -142,7 +148,7 @@ ErrorCode EvaluateSyscallImpl(int fs_denied_errno,
if (sysno == __NR_mprotect)
return RestrictMprotectFlags(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);
@@ -172,7 +178,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