Index: content/common/sandbox_linux/sandbox_linux.cc |
diff --git a/content/common/sandbox_linux/sandbox_linux.cc b/content/common/sandbox_linux/sandbox_linux.cc |
index 5e66737ef6936a9360fc25b2e2d7f3e263fe5e57..69cab56c9d557f91aa90d0eab5340afc55cddb97 100644 |
--- a/content/common/sandbox_linux/sandbox_linux.cc |
+++ b/content/common/sandbox_linux/sandbox_linux.cc |
@@ -112,6 +112,7 @@ LinuxSandbox::LinuxSandbox() |
sandbox_status_flags_(kSandboxLinuxInvalid), |
pre_initialized_(false), |
seccomp_bpf_supported_(false), |
+ seccomp_bpf_with_tsync_supported_(false), |
yama_is_enforcing_(false), |
initialize_sandbox_ran_(false), |
setuid_sandbox_client_(sandbox::SetuidSandboxClient::Create()) |
@@ -167,6 +168,10 @@ void LinuxSandbox::PreinitializeSandbox() { |
} else { |
seccomp_bpf_supported_ = true; |
} |
+ |
+ if (SandboxSeccompBPF::SupportsSandboxWithTsync()) { |
+ seccomp_bpf_with_tsync_supported_ = true; |
+ } |
} |
// Yama is a "global", system-level status. We assume it will not regress |
@@ -211,6 +216,11 @@ int LinuxSandbox::GetStatus() { |
sandbox_status_flags_ |= kSandboxLinuxSeccompBPF; |
} |
+ if (seccomp_bpf_with_tsync_supported() && |
+ SandboxSeccompBPF::ShouldEnableSeccompBPF(switches::kRendererProcess)) { |
+ sandbox_status_flags_ |= kSandboxLinuxSeccompTSYNC; |
+ } |
+ |
if (yama_is_enforcing_) { |
sandbox_status_flags_ |= kSandboxLinuxYama; |
} |
@@ -337,6 +347,11 @@ bool LinuxSandbox::seccomp_bpf_supported() const { |
return seccomp_bpf_supported_; |
} |
+bool LinuxSandbox::seccomp_bpf_with_tsync_supported() const { |
+ CHECK(pre_initialized_); |
+ return seccomp_bpf_with_tsync_supported_; |
+} |
+ |
bool LinuxSandbox::LimitAddressSpace(const std::string& process_type) { |
(void) process_type; |
#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \ |