Index: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
index 29c591035972264ed4765f6dde198591c4efb881..6c1832a5e991f496f7efee11992e085cf53d62c6 100644 |
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
@@ -34,6 +34,9 @@ |
#define MAP_STACK 0x20000 // Daisy build environment has old headers. |
#endif |
+#if defined(__mips__) && !defined(MAP_STACK) |
+#define MAP_STACK 0x40000 |
+#endif |
namespace { |
inline bool IsArchitectureX86_64() { |
@@ -60,6 +63,14 @@ inline bool IsAndroid() { |
#endif |
} |
+inline bool IsArchitectureMips() { |
+#if defined(__mips__) |
+ return true; |
+#else |
+ return false; |
+#endif |
+} |
+ |
} // namespace. |
namespace sandbox { |
@@ -155,7 +166,7 @@ ErrorCode RestrictFcntlCommands(SandboxBPF* sandbox) { |
// operator. |
// Glibc overrides the kernel's O_LARGEFILE value. Account for this. |
int kOLargeFileFlag = O_LARGEFILE; |
- if (IsArchitectureX86_64() || IsArchitectureI386()) |
+ if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips()) |
kOLargeFileFlag = 0100000; |
// TODO(jln): add TP_LONG/TP_SIZET types. |
@@ -202,7 +213,7 @@ ErrorCode RestrictFcntlCommands(SandboxBPF* sandbox) { |
sandbox->Trap(CrashSIGSYS_Handler, NULL)))))))))); |
} |
-#if defined(__i386__) |
+#if defined(__i386__) || defined(__mips__) |
ErrorCode RestrictSocketcallCommand(SandboxBPF* sandbox) { |
// Unfortunately, we are unable to restrict the first parameter to |
// socketpair(2). Whilst initially sounding bad, it's noteworthy that very |