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

Unified Diff: syzygy/agent/asan/heap_managers/block_heap_manager.cc

Issue 2378743002: [SyzyAsan] Disable registry filter for sandboxed processes. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « syzygy/agent/asan/heap_managers/block_heap_manager.h ('k') | syzygy/agent/asan/registry_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: syzygy/agent/asan/heap_managers/block_heap_manager.cc
diff --git a/syzygy/agent/asan/heap_managers/block_heap_manager.cc b/syzygy/agent/asan/heap_managers/block_heap_manager.cc
index 2548a95876bc034275f9d24d83da097ced78bb12..134b0928d63e2417b884cbe441fc0b8b66dcdf67 100644
--- a/syzygy/agent/asan/heap_managers/block_heap_manager.cc
+++ b/syzygy/agent/asan/heap_managers/block_heap_manager.cc
@@ -82,8 +82,7 @@ BlockHeapManager::BlockHeapManager(Shadow* shadow,
zebra_block_heap_id_(0),
large_block_heap_id_(0),
locked_heaps_(nullptr),
- enable_page_protections_(true),
- corrupt_block_registry_cache_(L"SyzyAsanCorruptBlocks") {
+ enable_page_protections_(true) {
DCHECK_NE(static_cast<Shadow*>(nullptr), shadow);
DCHECK_NE(static_cast<StackCaptureCache*>(nullptr), stack_cache);
DCHECK_NE(static_cast<MemoryNotifierInterface*>(nullptr), memory_notifier);
@@ -106,7 +105,14 @@ void BlockHeapManager::Init() {
{
base::AutoLock lock(lock_);
InitInternalHeap();
- corrupt_block_registry_cache_.Init();
+
+ // Only create a registry cache if the registry is available. It is not
+ // available in sandboxed Chrome renderer processes.
+ if (RegistryCache::RegistryAvailable()) {
+ corrupt_block_registry_cache_.reset(
+ new RegistryCache(L"SyzyAsanCorruptBlocks"));
+ corrupt_block_registry_cache_->Init();
+ }
}
// This takes care of its own locking, as its reentrant.
@@ -952,12 +958,15 @@ bool BlockHeapManager::ShouldReportCorruptBlock(const BlockInfo* block_info) {
// Look at the registry cache to see if an error has already been reported
// for this allocation stack trace, if so prevent from reporting another one.
- if (corrupt_block_registry_cache_.DoesIdExist(relative_alloc_stack_id))
- return false;
+ if (corrupt_block_registry_cache_.get()) {
+ if (corrupt_block_registry_cache_->DoesIdExist(relative_alloc_stack_id))
+ return false;
+
+ // Update the corrupt block registry cache to prevent from crashing if we
+ // encounter a corrupt block that has the same allocation stack trace.
+ corrupt_block_registry_cache_->AddOrUpdateStackId(relative_alloc_stack_id);
+ }
- // Update the corrupt block registry cache to prevent from crashing if we
- // encounter a corrupt block that has the same allocation stack trace.
- corrupt_block_registry_cache_.AddOrUpdateStackId(relative_alloc_stack_id);
return true;
}
« no previous file with comments | « syzygy/agent/asan/heap_managers/block_heap_manager.h ('k') | syzygy/agent/asan/registry_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698