[PATCH] D69576: [sanitizer_common] Create max_allocation_size_mb flag.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 12:49:19 PDT 2019


morehouse marked 2 inline comments as done.
morehouse added inline comments.


================
Comment at: compiler-rt/lib/asan/asan_allocator.cpp:288
+                                       : kMaxAllowedMallocSize;
   }
 
----------------
eugenis wrote:
> why not in SharedInitCode ?
> why not use Min(, kMaxAllowedMallocSize) same as you do in lsan and msan allocators?
> why not in SharedInitCode ?

`SharedInitCode` is also called from `ReInitialize`, which I think is redundant, since the common_flags wouldn't have changed (right?).

> why not use Min(, kMaxAllowedMallocSize) same as you do in lsan and msan allocators?

I'm not sure we want to include ASan metadata in this new limit, while we do include it for the check against `kMaxAllowedMallocSize`.


================
Comment at: compiler-rt/lib/asan/asan_allocator.cpp:444
+    if (size > kMaxAllowedMallocSize || needed_size > kMaxAllowedMallocSize ||
+        size > max_user_defined_malloc_size) {
       if (AllocatorMayReturnNull()) {
----------------
eugenis wrote:
> Do we need this  check as well?
> needed_size > max_user_defined_malloc_size
I *think* we only want to check `size` here, but I'm not sure.  @kcc Does Mozilla care about ASan metadata and alignment padding for this limit?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69576/new/

https://reviews.llvm.org/D69576





More information about the llvm-commits mailing list