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

Side by Side Diff: components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc

Issue 242383003: Linux sandbox test: temporarily allow fork() with threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sandbox/linux/tests/main.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/nacl/loader/nonsfi/nonsfi_sandbox.h" 5 #include "components/nacl/loader/nonsfi/nonsfi_sandbox.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <pthread.h> 9 #include <pthread.h>
10 #include <sched.h> 10 #include <sched.h>
(...skipping 11 matching lines...) Expand all
22 22
23 #include "base/bind.h" 23 #include "base/bind.h"
24 #include "base/callback.h" 24 #include "base/callback.h"
25 #include "base/compiler_specific.h" 25 #include "base/compiler_specific.h"
26 #include "base/files/scoped_file.h" 26 #include "base/files/scoped_file.h"
27 #include "base/logging.h" 27 #include "base/logging.h"
28 #include "base/posix/eintr_wrapper.h" 28 #include "base/posix/eintr_wrapper.h"
29 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" 29 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
30 #include "sandbox/linux/seccomp-bpf/bpf_tests.h" 30 #include "sandbox/linux/seccomp-bpf/bpf_tests.h"
31 31
32 // This is a hack. TODO(hamaji), fix crbug.com/364751.
33 namespace sandbox {
34 extern const bool kAllowForkWithThreads = true;
35 }
36
32 namespace { 37 namespace {
33 38
34 void DoPipe(base::ScopedFD* fds) { 39 void DoPipe(base::ScopedFD* fds) {
35 int tmp_fds[2]; 40 int tmp_fds[2];
36 BPF_ASSERT_EQ(0, pipe(tmp_fds)); 41 BPF_ASSERT_EQ(0, pipe(tmp_fds));
37 fds[0].reset(tmp_fds[0]); 42 fds[0].reset(tmp_fds[0]);
38 fds[1].reset(tmp_fds[1]); 43 fds[1].reset(tmp_fds[1]);
39 } 44 }
40 45
41 void DoSocketpair(base::ScopedFD* fds) { 46 void DoSocketpair(base::ScopedFD* fds) {
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 #if defined(__i386__) || defined(__x86_64__) 482 #if defined(__i386__) || defined(__x86_64__)
478 BPF_TEST(NaClNonSfiSandboxTest, time_EPERM, 483 BPF_TEST(NaClNonSfiSandboxTest, time_EPERM,
479 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) { 484 nacl::nonsfi::NaClNonSfiBPFSandboxPolicy::EvaluateSyscallImpl) {
480 errno = 0; 485 errno = 0;
481 BPF_ASSERT_EQ(-1, syscall(__NR_time)); 486 BPF_ASSERT_EQ(-1, syscall(__NR_time));
482 BPF_ASSERT_EQ(EPERM, errno); 487 BPF_ASSERT_EQ(EPERM, errno);
483 } 488 }
484 #endif 489 #endif
485 490
486 } // namespace 491 } // namespace
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/tests/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698