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

Unified Diff: content/common/sandbox_win.cc

Issue 868253011: Make chrome.exe built with ASan/Win work with sandbox enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more EXPECT turned into ASSERT Created 5 years, 10 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_win.cc
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index d89679bd472f1d61fb26540b2812976bdb1f95c2..17893ffa6fd399677431f2a16d8019002308ad03 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -339,6 +339,19 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy) {
return false;
#endif // NDEBUG
+ // Add the policy for read-only PDB file access for AddressSanitizer.
+#if defined(ADDRESS_SANITIZER)
+ base::FilePath exe;
+ if (!PathService::Get(base::FILE_EXE, &exe))
+ return false;
+ base::FilePath pdb_path = exe.DirName().Append(L"*.pdb");
+ result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
+ sandbox::TargetPolicy::FILES_ALLOW_READONLY,
+ pdb_path.value().c_str());
+ if (result != sandbox::SBOX_ALL_OK)
+ return false;
+#endif
+
AddGenericDllEvictionPolicy(policy);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698