summaryrefslogtreecommitdiff
path: root/lib/asan/asan_descriptions.cc
AgeCommit message (Collapse)Author
2018-07-09[ASan] Minor ASan error reporting cleanupAlex Shlyapnikov
Summary: - use proper Error() decorator for error messages - refactor ASan thread id and name reporting Reviewers: eugenis Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49044 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336573 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07[sanitizer] Remove reserving constructor from InternalMmapVectorVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@331617 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-28[asan] Add vfork to the list of reasons for stack errors.Evgeniy Stepanov
Until we figure out what to do with it, vfork can cause stack-based false positives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04[ASan] Enhance libsanitizer support for invalid-pointer-pair.Alex Shlyapnikov
Following patch adds support of all memory origins in CheckForInvalidPointerPair function. For small difference of pointers, it's directly done in shadow memory (the limit was set to 2048B). Then we search for origin of first pointer and verify that the second one has the same origin. If so, we verify that it points either to a same variable (in case of stack memory or a global variable), or to a same heap segment. Committing on behanf of marxin and jakubjelinek. Reviewers: alekseyshl, kcc Subscribers: llvm-commits Differential revision: https://reviews.llvm.org/D40600 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25[Sanitizers] ASan: detect new/delete calls with mismatched alignment.Alex Shlyapnikov
ASan allocator stores the requested alignment for new and new[] calls and on delete and delete[] verifies that alignments do match. The representable alignments are: default alignment, 8, 16, 32, 64, 128, 256 and 512 bytes. Alignments > 512 are stored as 512, hence two different alignments > 512 will pass the check (possibly masking the bug), but limited memory requirements deemed to be a resonable tradeoff for relaxed conditions. The feature is controlled by new_delete_type_mismatch flag, the same one protecting new/delete matching size check. Differential revision: https://reviews.llvm.org/D38574 Issue: https://github.com/google/sanitizers/issues/799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[compiler-rt] Cleanup decoratorsVitaly Buka
Summary: Removed redundant End*() methods which defined same way. Removed redundant Warning() methods. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37549 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[asan] Support line numbers in StackVarDescrKuba Mracek
When -fsanitize-address-use-after-scope is used, the instrumentation produces line numbers in stack frame descriptions. This patch make sure the ASan runtime supports this format (ParseFrameDescription needs to be able to parse "varname:line") and prepares lit tests to allow line numbers in ASan report output. Differential Revision: https://reviews.llvm.org/D31484 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20[asan] Fix GlobalAddressDescription::Print()Filipe Cabecinhas
Summary: Check bug_type for nullptr before calling internal_strcmp Reviewers: kcc, vitalybuka, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24773 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282012 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[asan] Store access_size in the {Stack,Global}AddressDescription objectsFilipe Cabecinhas
Summary: This is important information when we want to describe errors, and should be part of these descriptions. Otherwise, we need to know the access size when printing/emitting the description. Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24387 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09[asan] Add a new AddressDescription structure, which can describe any type ↵Filipe Cabecinhas
of address. Summary: This is useful for inclusion in the Error* structures, to describe an arbitrary address. Remove the old struct since it's used only once. This removes one level of indirection, and moves all *AddressDescription to be one of the recently introduced structures. This merges differential revisions: D24131 and D24132 Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24131 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19Cleanup: Move the *AddressDescription printing code to Print() members ↵Filipe Cabecinhas
inside those structs. Summary: The Print() members might take optional access_size and bug_type parameters to still be able to provide the same information Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17Split DescribeAddressIfGlobal between a function that gets all the ↵Filipe Cabecinhas
information, and one that prints it. Summary: Replacement for part of D23518 This deals with global variable addresses. (This commit is written on top of D23605, but can be applied by itself) Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23607 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17Split DescribeAddressIfStack between a function that gets all the ↵Filipe Cabecinhas
information, and one that prints it. Summary: Replacement for part of D23518 This deals with stack addresses. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23605 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17Deal with buildbot fallout from r278917: s/AllocType()/GetAllocType()/ (had ↵Filipe Cabecinhas
the same name as the enum) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17Rename DescribeHeapAddress to DescribeAddressIfHeap and split it into a ↵Filipe Cabecinhas
function to get all the information about the address, and one to print it. Summary: Replacement for part of D23518 This deals with heap addresses, and renames DescribeHeapAddress. Requires D23520, which moves code around to make it accessible in asan_describers.cc (and still accessible in asan_report.cc if needed). Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23569 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16Move the Decorator, ThreadNameWithParenthesis, and DescribeThread to ↵Filipe Cabecinhas
asan_descriptions.{h,cc} Summary: Replacement for part of D23518 Code refactoring to allow us to move some more DescribeAddressIf* functions to work by getting the structured information, and then printing it. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23520 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15Split DescribeAddressIfShadow between a function that gets all the ↵Filipe Cabecinhas
information, and one that prints it. Summary: Replacement for part of D23518 This is the first patch to start reifying information about errors. It deals only with reifying shadow address-related information. It will allow us to generate structures with all the relevant information for a given error so a debugger can get to them or they can be included in a core dump. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23519 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278718 91177308-0d34-0410-b5e6-96231b3b80d8