diff options
author | Tacet <advenam.tacet@trailofbits.com> | 2024-01-13 18:11:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-13 18:11:53 +0100 |
commit | 60ac394dc9ed617f802b33c3b9ac8881ca6a940c (patch) | |
tree | f45cdd3498f8d6a380919a30bcb8a9846d2d974a /llvm/lib/Support/CommandLine.cpp | |
parent | 9c33a2e9a3202c9e04bd359df14708ad2fa45387 (diff) | |
download | llvm-60ac394dc9ed617f802b33c3b9ac8881ca6a940c.zip llvm-60ac394dc9ed617f802b33c3b9ac8881ca6a940c.tar.gz llvm-60ac394dc9ed617f802b33c3b9ac8881ca6a940c.tar.bz2 |
[ASan][libc++] Annotating `std::basic_string` with all allocators (#75845)
This commit turns on ASan annotations in `std::basic_string` for all
allocators by default.
Originally suggested here: https://reviews.llvm.org/D146214
String annotations added here:
https://github.com/llvm/llvm-project/pull/72677
This commit is part of our efforts to support container annotations with
(almost) every allocator. Annotating `std::basic_string` with default
allocator is implemented in
https://github.com/llvm/llvm-project/pull/72677.
Additionally it removes `__begin != nullptr` because `data()` should
never return a nullptr.
Support in ASan API exists since
https://github.com/llvm/llvm-project/commit/1c5ad6d2c01294a0decde43a88e9c27d7437d157.
This patch removes the check in std::basic_string annotation member
function (__annotate_contiguous_container) to support different
allocators.
You can turn off annotations for a specific allocator based on changes
from
https://github.com/llvm/llvm-project/commit/2fa1bec7a20bb23f2e6620085adb257dafaa3be0.
The motivation for a 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 call to `std::equal` 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.
If you have any questions, please email:
- advenam.tacet@trailofbits.com
- disconnect3d@trailofbits.com
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions