aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-readobj/llvm-readobj.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2020-12-21 18:39:03 -0800
committerPeter Collingbourne <peter@pcc.me.uk>2021-03-08 14:39:33 -0800
commit3f71ce85897cc92190af6a66c5b2dcffc85212e2 (patch)
treeb004d1f53ef2da95f859b3fe0013862cca5a9bdc /llvm/tools/llvm-readobj/llvm-readobj.cpp
parentc05d574a98592228fdba7d350e9a1e4f40d18e2e (diff)
downloadllvm-3f71ce85897cc92190af6a66c5b2dcffc85212e2.zip
llvm-3f71ce85897cc92190af6a66c5b2dcffc85212e2.tar.gz
llvm-3f71ce85897cc92190af6a66c5b2dcffc85212e2.tar.bz2
scudo: Support memory tagging in the secondary allocator.
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 7a0da8894348 which was reverted in commit 9678b07e42ee. This reland includes the following changes: - Fix the calculation of BlockSize which led to incorrect statistics returned by mallinfo(). - Add -Wno-pedantic to silence GCC warning. - Optionally add some slack at the end of secondary allocations to help work around buggy applications that read off the end of their allocation. Differential Revision: https://reviews.llvm.org/D93731
Diffstat (limited to 'llvm/tools/llvm-readobj/llvm-readobj.cpp')
0 files changed, 0 insertions, 0 deletions