summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_allocator_size_class_map.h
AgeCommit message (Collapse)Author
2017-08-28[sanitizer] Re-introduce kUseSeparateSizeClassForBatch for the 32-bit PrimaryKostya Kortchinsky
Summary: Currently `TransferBatch` are located within the same memory regions as "regular" chunks. This is not ideal for security: they make for an interesting target to overwrite, and are not protected by the frontend (namely, Scudo). To solve this, we re-introduce `kUseSeparateSizeClassForBatch` for the 32-bit Primary allowing for `TransferBatch` to end up in their own memory region. Currently only Scudo would use this new feature, the default behavior remains unchanged. The separate `kBatchClassID` was used for a brief period of time previously but removed when the 64-bit ended up using the "free array". Reviewers: alekseyshl, kcc, eugenis Reviewed By: alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37082 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@311891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31[sanitizer] extend SizeClassMap to take more template parameters, add ↵Kostya Serebryany
VeryCompactSizeClassMap for testing purposes git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31[sanitizer] remove kBatchClassID that is not used any more; NFCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23[sanitizer] allocator: split the local cache class into two, one for 32-bit ↵Kostya Serebryany
allocator and one for 64-bit one. NFC. The two imlementations will diverge in the following changes. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09[sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit ↵Kostya Serebryany
allocator's transfer batches. This saves 2x memory for the transfer batches (up to ~1.5% overall in some cases) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-06[sanitizer] allocator: move TransferBatch into ↵Kostya Serebryany
SizeClassAllocator64/SizeClassAllocator32 because we actually need different iplementations for the 64- and 32-bit case. NFC; the following patches will make the TransferBatch implementations differ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277899 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03[sanitizer] refactor TransferBatch to hide the implementation. NFC expected. ↵Kostya Serebryany
Second attempt after failed r276383 which was reverted. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277554 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22[sanitizer] revert r276383 while investigating failures on botKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22[sanitizer] refactor TransferBatch to hide the implementation. NFCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-22[sanitizer] allocator: introduce kUseSeparateSizeClassForBatch (false by ↵Kostya Serebryany
default). When true, it will cause all TransferBatches to be allocated on a separate dedicated size class, which improves security and may potentially simplify memory reclamation. However in the current state this may cause up to 3% extra memory usage. Subsequent changes should bring this overhead down git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21[sanitizer] allocator: remove kPopulateSize and only use ↵Kostya Serebryany
SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20[sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFCKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276195 91177308-0d34-0410-b5e6-96231b3b80d8