summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-111-1/+1
| | | | llvm-svn: 371687
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [Sanitizers] Check alignment != 0 for aligned_alloc and posix_memalignAlex Shlyapnikov2018-06-081-3/+5
| | | | | | | | | | | | | | | Summary: Move the corresponding tests to the common folder (as all of the sanitizer allocators will support this feature soon) and add the checks specific to aligned_alloc to ASan and LSan allocators. Reviewers: vitalybuka Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D47924 llvm-svn: 334316
* [sanitizer] Move the errno/ENOMEM allocator checks logic to separate .ccKostya Kortchinsky2017-10-111-2/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a new attempt at D38706, which had 2 issues. The first one was that it broke TSan, because `sanitizer_errno.h` was not directly included in `tsan_mman.cc`. This fixes the include. The second one was that it broke the nolibc build, because `__errno_location` couldn't be found. This adds the new .cc to the libcdep list instead of the base one. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38743 llvm-svn: 315509
* [sanitizer] Revert D38706Kostya Kortchinsky2017-10-101-7/+2
| | | | | | | | | | | | | | Summary: D38706 breaks tsan and the nolibc build. Reverting while working on a fix. Reviewers: alekseyshl Subscribers: kubamracek, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38739 llvm-svn: 315320
* [sanitizer] Move the errno/ENOMEM allocator checks logic to separate .ccKostya Kortchinsky2017-10-101-2/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: The fact that `sanitizer_allocator_checks.h` is including `sanitizer_errno.h` creates complications for future changes, where it would conflict with `errno.h` definitions on Android and Fuchsia (macro redefinition). By moving the portion that sets errno in the checks to a separate compilation unit, we avoid the inclusion of the header there, which solves the issue. Not that it is not vital to have that function in a header as it is called as a result of an unlikely event, and doesn't need to be inlined. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38706 llvm-svn: 315319
* [scudo] Check for pvalloc overflowKostya Kortchinsky2017-07-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we were rounding up the size passed to `pvalloc` to the next multiple of page size no matter what. There is an overflow possibility that wasn't accounted for. So now, return null in the event of an overflow. The man page doesn't seem to indicate the errno to set in this particular situation, but the glibc unit tests go for ENOMEM (https://code.woboq.org/userspace/glibc/malloc/tst-pvalloc.c.html#54) so we'll do the same. Update the aligned allocation funtions tests to check for properly aligned returned pointers, and the `pvalloc` corner cases. @alekseyshl: do you want me to do the same in the other Sanitizers? Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, alekseyshl, llvm-commits Differential Revision: https://reviews.llvm.org/D35818 llvm-svn: 309033
* [Sanitizers] ASan/MSan/LSan allocators set errno on failure.Alex Shlyapnikov2017-07-181-0/+64
Summary: ASan/MSan/LSan allocators set errno on allocation failures according to malloc/calloc/etc. expected behavior. MSan allocator was refactored a bit to make its structure more similar with other allocators. Also switch Scudo allocator to the internal errno definitions. TSan allocator changes will follow. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D35275 llvm-svn: 308344
OpenPOWER on IntegriCloud