OLD | NEW |
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 <errno.h> | 5 #include <errno.h> |
6 #include <pthread.h> | 6 #include <pthread.h> |
7 #include <sched.h> | 7 #include <sched.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <sys/prctl.h> | 9 #include <sys/prctl.h> |
10 #include <sys/ptrace.h> | 10 #include <sys/ptrace.h> |
(...skipping 2232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2243 SANDBOX_DEATH_TEST(SandboxBPF, StartMultiThreadedAsSingleThreaded, | 2243 SANDBOX_DEATH_TEST(SandboxBPF, StartMultiThreadedAsSingleThreaded, |
2244 DEATH_MESSAGE("Cannot start sandbox; process is already multi-threaded")) { | 2244 DEATH_MESSAGE("Cannot start sandbox; process is already multi-threaded")) { |
2245 base::Thread thread("sandbox.linux.StartMultiThreadedAsSingleThreaded"); | 2245 base::Thread thread("sandbox.linux.StartMultiThreadedAsSingleThreaded"); |
2246 BPF_ASSERT(thread.Start()); | 2246 BPF_ASSERT(thread.Start()); |
2247 | 2247 |
2248 SandboxBPF sandbox; | 2248 SandboxBPF sandbox; |
2249 sandbox.SetSandboxPolicy(new AllowAllPolicy()); | 2249 sandbox.SetSandboxPolicy(new AllowAllPolicy()); |
2250 BPF_ASSERT(!sandbox.StartSandbox(SandboxBPF::PROCESS_SINGLE_THREADED)); | 2250 BPF_ASSERT(!sandbox.StartSandbox(SandboxBPF::PROCESS_SINGLE_THREADED)); |
2251 } | 2251 } |
2252 | 2252 |
| 2253 // http://crbug.com/407357 |
| 2254 #if !defined(THREAD_SANITIZER) |
2253 SANDBOX_DEATH_TEST(SandboxBPF, StartSingleThreadedAsMultiThreaded, | 2255 SANDBOX_DEATH_TEST(SandboxBPF, StartSingleThreadedAsMultiThreaded, |
2254 DEATH_MESSAGE("Cannot start sandbox; process may be single-threaded when " | 2256 DEATH_MESSAGE("Cannot start sandbox; process may be single-threaded when " |
2255 "reported as not")) { | 2257 "reported as not")) { |
2256 SandboxBPF sandbox; | 2258 SandboxBPF sandbox; |
2257 sandbox.SetSandboxPolicy(new AllowAllPolicy()); | 2259 sandbox.SetSandboxPolicy(new AllowAllPolicy()); |
2258 BPF_ASSERT(!sandbox.StartSandbox(SandboxBPF::PROCESS_MULTI_THREADED)); | 2260 BPF_ASSERT(!sandbox.StartSandbox(SandboxBPF::PROCESS_MULTI_THREADED)); |
2259 } | 2261 } |
| 2262 #endif // !defined(THREAD_SANITIZER) |
2260 | 2263 |
2261 } // namespace | 2264 } // namespace |
2262 | 2265 |
2263 } // namespace sandbox | 2266 } // namespace sandbox |
OLD | NEW |