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

Unified Diff: content/common/sandbox_linux/sandbox_linux.cc

Issue 280303002: Add sandbox support for AsanCoverage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698