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; |
} |