Chromium Code Reviews| 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 237cc89deb9947af3d96fe8753e641a7c907f07a..2592c86a7d6d38a73c4e9427a3633a0d83a59bd0 100644 |
| --- a/content/common/sandbox_linux/sandbox_linux.cc |
| +++ b/content/common/sandbox_linux/sandbox_linux.cc |
| @@ -109,7 +109,12 @@ LinuxSandbox::LinuxSandbox() |
| pre_initialized_(false), |
| seccomp_bpf_supported_(false), |
| yama_is_enforcing_(false), |
| - setuid_sandbox_client_(sandbox::SetuidSandboxClient::Create()) { |
| + setuid_sandbox_client_(sandbox::SetuidSandboxClient::Create()) |
| +#if (defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \ |
| + defined(LEAK_SANITIZER)) && defined(OS_LINUX) |
| + , sanitizer_args_(NULL) |
| +#endif |
| +{ |
| if (setuid_sandbox_client_ == NULL) { |
| LOG(FATAL) << "Failed to instantiate the setuid sandbox client."; |
| } |
| @@ -128,6 +133,10 @@ LinuxSandbox* LinuxSandbox::GetInstance() { |
| defined(LEAK_SANITIZER)) && defined(OS_LINUX) |
| // Sanitizer API call to notify the tool the sandbox is going to be turned on. |
| extern "C" void __sanitizer_sandbox_on_notify(void *reserved); |
| + |
| +void LinuxSandbox::SetSanitizerArgs(void *sanitizer_args) { |
|
jln (very slow on Chromium)
2014/05/13 01:17:35
style: "void* blah".
jln (very slow on Chromium)
2014/05/13 01:17:35
Let's respect the order of declarations in the hea
earthdok
2014/05/14 17:00:26
Done.
earthdok
2014/05/14 17:00:26
Done.
|
| + sanitizer_args_ = sanitizer_args; |
| +} |
| #endif |
| void LinuxSandbox::PreinitializeSandbox() { |
| @@ -137,7 +146,7 @@ void LinuxSandbox::PreinitializeSandbox() { |
| defined(LEAK_SANITIZER)) && defined(OS_LINUX) |
| // Sanitizers need to open some resources before the sandbox is enabled. |
| // This should not fork, not launch threads, not open a directory. |
| - __sanitizer_sandbox_on_notify(/*reserved*/ NULL); |
| + __sanitizer_sandbox_on_notify(sanitizer_args_); |
| #endif |
| #if !defined(NDEBUG) |