Index: sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc |
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc |
index b8ae3b72407fc94883b22cf06043d23f16415bd9..699855f9ab361e91b178b5f677f8fe48f68c8034 100644 |
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc |
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc |
@@ -13,6 +13,9 @@ using namespace playground2; |
namespace { |
const int kExpectedReturnValue = 42; |
+#if defined(__arm__) |
+const int kArmPublicSysnoCeiling = __NR_SYSCALL_BASE + 1024; |
+#endif |
TEST(SandboxBpf, CallSupports) { |
// We check that we don't crash, but it's ok if the kernel doesn't |
@@ -234,6 +237,13 @@ Sandbox::ErrorCode SyntheticPolicy(int sysno) { |
// FIXME: we should really not have to do that in a trivial policy. |
return ENOSYS; |
} |
+ |
+ // TODO(jorgelo): remove this restriction once crbug.com/141694 is fixed. |
+#if defined(__arm__) |
+ if (sysno > kArmPublicSysnoCeiling) |
+ return ENOSYS; |
+#endif |
+ |
if (sysno == __NR_exit_group) { |
// exit_group() is special, we really need it to work. |
return Sandbox::SB_ALLOWED; |
@@ -249,8 +259,16 @@ void SyntheticProcess(void) { |
static_cast<int>(MAX_SYSCALL)) { |
ExitGroup(1); |
} |
+ |
+ // TODO(jorgelo): remove this limit once crbug.com/141694 is fixed. |
+#if defined(__arm__) |
+ int sysno_ceiling = kArmPublicSysnoCeiling; |
jln (very slow on Chromium)
2012/08/09 22:41:23
These should be const.
Jorge Lucangeli Obes
2012/08/09 22:58:26
Done.
|
+#else |
+ int sysno_ceiling = static_cast<int>(MAX_SYSCALL); |
+#endif |
+ |
for (int syscall_number = static_cast<int>(MIN_SYSCALL); |
- syscall_number <= static_cast<int>(MAX_SYSCALL); |
+ syscall_number <= sysno_ceiling; |
++syscall_number) { |
if (syscall_number == __NR_exit_group) { |
// exit_group() is special |