Commit d6b6dcb1 authored by leecam's avatar leecam Committed by Commit bot

sandbox: sandbox_linux_unittests enforces TSYNC on ChromeOS

Make Seccomp-bpf tsync support mandatory on ChromeOS now
that all kernels support it.

BUG=
TEST=ChromeOS trybots

Review URL: https://codereview.chromium.org/759343002

Cr-Commit-Position: refs/heads/master@{#306673}
parent a0ab3851
......@@ -30,6 +30,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/posix/eintr_wrapper.h"
#include "base/synchronization/waitable_event.h"
#include "base/sys_info.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
#include "sandbox/linux/bpf_dsl/policy.h"
......@@ -2253,8 +2254,17 @@ void* TsyncApplyToTwoThreadsFunc(void* cond_ptr) {
}
SANDBOX_TEST(SandboxBPF, Tsync) {
if (!(SandboxBPF::SupportsSeccompSandbox(
SandboxBPF::SeccompLevel::MULTI_THREADED))) {
const bool supports_multi_threaded = SandboxBPF::SupportsSeccompSandbox(
SandboxBPF::SeccompLevel::MULTI_THREADED);
// On Chrome OS tsync is mandatory.
#if defined(OS_CHROMEOS)
if (base::SysInfo::IsRunningOnChromeOS()) {
BPF_ASSERT_EQ(true, supports_multi_threaded);
}
// else a Chrome OS build not running on a Chrome OS device e.g. Chrome bots.
// In this case fall through.
#endif
if (!supports_multi_threaded) {
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment