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

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: Created 5 years, 11 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..e34db686836fe876442d41db8453febd56a249b5 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -339,6 +339,21 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy) {
return false;
#endif // NDEBUG
+ // Add the policy for read-only PDB file access for AddressSanitizer.
+#if defined(ADDRESS_SANITIZER)
+ wchar_t main_module_path[MAX_PATH];
cpu_(ooo_6.6-7.5) 2015/01/30 20:28:24 use base::FILE_EXE or base::FILE_MODULE
Timur Iskhodzhanov 2015/02/02 15:38:58 Done, thanks! Also fixed a similar code in the ASa
+ DWORD ret = ::GetModuleFileName(NULL, main_module_path, MAX_PATH);
+ if (0 == ret || ret >= MAX_PATH)
+ return false;
+ base::FilePath pdb_path =
+ base::FilePath(main_module_path).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