summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_allocator_size_class_map.h
Commit message (Collapse)AuthorAgeFilesLines
* [sanitizer] Re-introduce kUseSeparateSizeClassForBatch for the 32-bit PrimaryKostya Kortchinsky2017-08-281-7/+23
| | | | | | | | | | | | | | | | | | | | | | | 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
* [sanitizer] extend SizeClassMap to take more template parameters, add ↵Kostya Serebryany2016-08-311-10/+51
| | | | | | VeryCompactSizeClassMap for testing purposes git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280266 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] remove kBatchClassID that is not used any more; NFCKostya Serebryany2016-08-311-16/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280185 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] allocator: split the local cache class into two, one for 32-bit ↵Kostya Serebryany2016-08-231-1/+0
| | | | | | 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
* [sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit ↵Kostya Serebryany2016-08-091-11/+14
| | | | | | 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
* [sanitizer] allocator: move TransferBatch into ↵Kostya Serebryany2016-08-061-55/+8
| | | | | | 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
* [sanitizer] refactor TransferBatch to hide the implementation. NFC expected. ↵Kostya Serebryany2016-08-031-3/+26
| | | | | | 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
* [sanitizer] revert r276383 while investigating failures on botKostya Serebryany2016-07-221-18/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276456 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] refactor TransferBatch to hide the implementation. NFCKostya Serebryany2016-07-221-3/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276383 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] allocator: introduce kUseSeparateSizeClassForBatch (false by ↵Kostya Serebryany2016-07-221-6/+29
| | | | | | 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
* [sanitizer] allocator: remove kPopulateSize and only use ↵Kostya Serebryany2016-07-211-2/+5
| | | | | | 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
* [sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFCKostya Serebryany2016-07-201-0/+186
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276195 91177308-0d34-0410-b5e6-96231b3b80d8