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

Unified Diff: syzygy/agent/asan/block.cc

Issue 2527533003: Make SyzyAsan support the allocation > 1GB (Closed)
Patch Set: Move the limit to block.h/cc Created 4 years, 1 month 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: syzygy/agent/asan/block.cc
diff --git a/syzygy/agent/asan/block.cc b/syzygy/agent/asan/block.cc
index 3399d02c7a21483f652386775b76d9472b03bf4d..2e639e731ff165588291e6ccf572522b53cef35e 100644
--- a/syzygy/agent/asan/block.cc
+++ b/syzygy/agent/asan/block.cc
@@ -239,6 +239,11 @@ bool BlockPlanLayout(uint32_t chunk_size,
DCHECK_GE(chunk_size, alignment);
DCHECK(::common::IsPowerOfTwo(alignment));
+ // Prevent from trying to allocate a memory block bigger than what we can
+ // represent in the block header.
+ if (size > kBlockMaxAllocSize)
+ return false;
+
// Calculate minimum redzone sizes that respect the parameters.
uint32_t left_redzone_size = static_cast<uint32_t>(::common::AlignUp(
std::max<uint32_t>(min_left_redzone_size, sizeof(BlockHeader)),

Powered by Google App Engine
This is Rietveld 408576698