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

Unified Diff: sandbox/win/src/target_services.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: Addressed a review comment 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: sandbox/win/src/target_services.cc
diff --git a/sandbox/win/src/target_services.cc b/sandbox/win/src/target_services.cc
index 03813c8feb7bf691bd6ffb051c681b7e5d9099ad..bd33c050e814593c7a91228534aca5a67e9e13be 100644
--- a/sandbox/win/src/target_services.cc
+++ b/sandbox/win/src/target_services.cc
@@ -74,6 +74,14 @@ ResultCode TargetServicesBase::Init() {
// Failure here is a breach of security so the process is terminated.
void TargetServicesBase::LowerToken() {
+#if defined(ADDRESS_SANITIZER)
+ // Bind and leak dbghelp.dll before the token is lowered, otherwise
+ // AddressSanitizer will crash when trying to symbolize a report.
+ // TODO: find a better place to do this?
rvargas (doing something else) 2015/02/02 20:55:58 I'd say this is a type of warming so it should be
Timur Iskhodzhanov 2015/02/02 21:28:38 Carlos, do you agree? Btw, the *.pdb policy is se
+ if (!LoadLibraryA("dbghelp.dll"))
+ // TODO: If this is a good place, define a new SBOX_FATAL exit code.
+ ::TerminateProcess(::GetCurrentProcess(), 0x1234);
+#endif
if (ERROR_SUCCESS !=
SetProcessIntegrityLevel(g_shared_delayed_integrity_level))
::TerminateProcess(::GetCurrentProcess(), SBOX_FATAL_INTEGRITY);

Powered by Google App Engine
This is Rietveld 408576698