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

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

Issue 2527533003: Make SyzyAsan support the allocation > 1GB (Closed)
Patch Set: Do an unguarded alloc if the size > 2GB 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..c0f6e8f96e0347881806ba1c1f1b1fdc937a18b2 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 > kMaxBlockHeaderBodySize)
+ 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