[PATCH] D32310: [scudo] Bypass Quarantine if its size is set to 0

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 14:41:45 PDT 2017


cryptoad created this revision.

In the current state of things, the deallocation path puts a chunk in the
Quarantine whether it's enabled or not (size of 0). When the Quarantine is
disabled, this results in the header being loaded (and checked) twice, and
stored (and checksummed) once, in `deallocate` and `Recycle`.

This change introduces a `quarantineOrDeallocateChunk` function that has a
fast path to deallocation if the Quarantine is disabled. Even though this is
not the preferred configuration security-wise, this change saves a sizeable
amount of processing for that particular situation (which could be adopted by
low memory devices). Additionally this simplifies a bit `deallocate` and
`reallocate`.


https://reviews.llvm.org/D32310

Files:
  lib/scudo/scudo_allocator.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32310.96023.patch
Type: text/x-patch
Size: 4418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170420/2aec9b02/attachment.bin>


More information about the llvm-commits mailing list