[all-commits] [llvm/llvm-project] 7bf5f6: Revert "[ASan][libcxx] Annotating std::vector with...
Hans via All-commits
all-commits at lists.llvm.org
Mon Jan 30 04:25:11 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7bf5f62574e23ba56447aca2530197d8577b59fd
https://github.com/llvm/llvm-project/commit/7bf5f62574e23ba56447aca2530197d8577b59fd
Author: Hans Wennborg <hans at chromium.org>
Date: 2023-01-30 (Mon, 30 Jan 2023)
Changed paths:
M libcxx/include/vector
M libcxx/test/libcxx/containers/sequences/vector/asan.pass.cpp
M libcxx/test/support/min_allocator.h
Log Message:
-----------
Revert "[ASan][libcxx] Annotating std::vector with all allocators"
This caused false container-overflow errors when using a custom allocator that
touches the memory on deallocation: GitHub Issue #60384
> This revision is a part of a series of patches extending
> AddressSanitizer C++ container overflow detection
> capabilities by adding annotations, similar to those existing
> in std::vector, to std::string and std::deque collections.
> These changes allow ASan to detect cases when the instrumented
> program accesses memory which is internally allocated by
> the collection but is still not in-use (accesses before or
> after the stored elements for std::deque, or between the size and
> capacity bounds for std::string).
>
> The motivation for the research and those changes was a bug,
> found by Trail of Bits, in a real code where an out-of-bounds read
> could happen as two strings were compared via a std::equals function
> that took iter1_begin, iter1_end, iter2_begin iterators
> (with a custom comparison function).
> When object iter1 was longer than iter2, read out-of-bounds on iter2
> could happen. Container sanitization would detect it.
>
> In revision D132522, support for non-aligned memory buffers (sharing
> first/last granule with other objects) was added, therefore the
> check for standard allocator is not necessary anymore.
> This patch removes the check in std::vector annotation member
> function (__annotate_contiguous_container) to support
> different allocators.
>
> If you have any questions, please email:
> - advenam.tacet at trailofbits.com
> - disconnect3d at trailofbits.com
>
> Reviewed By: #libc, #sanitizers, philnik, vitalybuka
>
> Spies: EricWF, philnik, #sanitizers, libcxx-commits
>
> Differential Revision: https://reviews.llvm.org/D136765
This reverts commit 490555026821db47d1cf4bf08c219b3e56ec6b45.
More information about the All-commits
mailing list