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 2b002b4d235c96481178b56cbf8969cf8045c07e..e954904e31c54175824e4dfd290ed859c22d446d 100644 |
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
@@ -33,6 +33,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 RunningOnASAN() { |
@@ -59,6 +62,13 @@ inline bool IsArchitectureI386() { |
#endif |
} |
+inline bool IsArchitectureMips() { |
+#if defined(__mips__) |
+ return true; |
+#else |
+ return false; |
+#endif |
+} |
} // namespace. |
namespace sandbox { |
@@ -139,7 +149,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. |
@@ -186,7 +196,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 |