forked from OSchip/llvm-project
3f71ce8589
This patch enhances the secondary allocator to be able to detect buffer overflow, and (on hardware supporting memory tagging) use-after-free and buffer underflow. Use-after-free detection is implemented by setting memory page protection to PROT_NONE on free. Because this must be done immediately rather than after the memory has been quarantined, we no longer use the combined allocator quarantine for secondary allocations. Instead, a quarantine has been added to the secondary allocator cache. Buffer overflow detection is implemented by aligning the allocation to the right of the writable pages, so that any overflows will spill into the guard page to the right of the allocation, which will have PROT_NONE page protection. Because this would require the secondary allocator to produce a header at the correct position, the responsibility for ensuring chunk alignment has been moved to the secondary allocator. Buffer underflow detection has been implemented on hardware supporting memory tagging by tagging the memory region between the start of the mapping and the start of the allocation with a non-zero tag. Due to the cost of pre-tagging secondary allocations and the memory bandwidth cost of tagged accesses, the allocation itself uses a tag of 0 and only the first four pages have memory tagging enabled. This is a reland of commit |
||
---|---|---|
.. | ||
cmake | ||
docs | ||
include | ||
lib | ||
test | ||
tools | ||
unittests | ||
utils | ||
www | ||
.clang-tidy | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.TXT | ||
CREDITS.TXT | ||
LICENSE.TXT | ||
README.txt |
README.txt
Compiler-RT ================================ This directory and its subdirectories contain source code for the compiler support routines. Compiler-RT is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. ================================