summaryrefslogtreecommitdiff
path: root/lib/asan/asan_descriptions.h
AgeCommit message (Collapse)Author
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-13[compiler-rt] Move dump_instruction_bytes and dump_registers into ↵Vitaly Buka
sanitizer_common Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37766 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313117 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
2016-09-21[asan] Reify ErrorGenericFilipe Cabecinhas
Summary: Finish work on PR30351 (last one, after D24551, D24552, and D24554 land) Also replace the old ReportData structure/variable with the current_error_ static member of the ScopedInErrorReport class. This has the following side-effects: - Move ASAN_ON_ERROR(); call to the start of the destructor, instead of in StartReporting(). - We only generate the error structure after the ScopedInErrorReport constructor finishes, so we can't call ASAN_ON_ERROR() during the constructor. I think this makes more sense, since we end up never running two of the ASAN_ON_ERROR() callback. This also works the same way as error reporting, since we end up having a lock around it. Otherwise we could end up with the ASAN_ON_ERROR() call for error 1, then the ASAN_ON_ERROR() call for error 2, and then lock the mutex for reporting error 1. - The __asan_get_report_* functions will be able to, in the future, provide information about other errors that aren't a "generic error". But we might want to rethink that API, since it's too restricted. Ideally we teach lldb about the current_error_ member of ScopedInErrorReport. Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24555 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282107 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-25[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279789 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-18Add header guards to asan_descriptions.hFilipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17[asan] Remove "Stack partial redzone" from reportVitaly Buka
Summary: This value is never used. Reviewers: kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23631 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279010 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-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