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

Side by Side Diff: sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc

Issue 11612014: Linux sandbox: modify GYP files to compile under Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add linux_syscalls.h Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp-bpf/sandbox_bpf.h ('k') | sandbox/linux/seccomp-bpf/syscall.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sys/prctl.h> 5 #include <sys/syscall.h>
6 #include <sys/utsname.h> 6 #include <sys/utsname.h>
7 7
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" 11 #include "sandbox/linux/seccomp-bpf/bpf_tests.h"
12 #include "sandbox/linux/seccomp-bpf/syscall.h" 12 #include "sandbox/linux/seccomp-bpf/syscall.h"
13 #include "sandbox/linux/seccomp-bpf/verifier.h" 13 #include "sandbox/linux/seccomp-bpf/verifier.h"
14 #include "sandbox/linux/services/broker_process.h" 14 #include "sandbox/linux/services/broker_process.h"
15 #include "sandbox/linux/services/linux_syscalls.h"
15 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
16 17
17 using namespace playground2; 18 using namespace playground2;
18 using sandbox::BrokerProcess; 19 using sandbox::BrokerProcess;
19 20
20 namespace { 21 namespace {
21 22
22 const int kExpectedReturnValue = 42; 23 const int kExpectedReturnValue = 42;
23 24
24 // This test should execute no matter whether we have kernel support. So, 25 // This test should execute no matter whether we have kernel support. So,
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 DEATH_MESSAGE("Unexpected 64bit argument detected"), 955 DEATH_MESSAGE("Unexpected 64bit argument detected"),
955 EqualityWithNegativeArgumentsPolicy) { 956 EqualityWithNegativeArgumentsPolicy) {
956 // When expecting a 32bit system call argument, we look at the MSB of the 957 // When expecting a 32bit system call argument, we look at the MSB of the
957 // 64bit value and allow both "0" and "-1". But the latter is allowed only 958 // 64bit value and allow both "0" and "-1". But the latter is allowed only
958 // iff the LSB was negative. So, this death test should error out. 959 // iff the LSB was negative. So, this death test should error out.
959 BPF_ASSERT(SandboxSyscall(__NR_uname, 0xFFFFFFFF00000000ll) == -1); 960 BPF_ASSERT(SandboxSyscall(__NR_uname, 0xFFFFFFFF00000000ll) == -1);
960 } 961 }
961 #endif 962 #endif
962 963
963 } // namespace 964 } // namespace
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/sandbox_bpf.h ('k') | sandbox/linux/seccomp-bpf/syscall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698