summaryrefslogtreecommitdiff
path: root/lib/asan/asan_errors.h
AgeCommit message (Collapse)Author
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-14[asan] Remove ErrorStackOverflowVitaly Buka
Summary: The only difference from ErrorDeadlySignal is reporting code and it lives in sanitizer common. Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl, filcab Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37868 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Use SignalContext in ErrorStackOverflow and ErrorDeadlySignalVitaly Buka
Summary: Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl, filcab Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37793 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Add siginfo into SignalContextVitaly Buka
Summary: Information stored there is often been passed along with SignalContext. Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37792 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28[asan] Provide bug descriptions for all reports (not just ErrorGeneric)Kuba Mracek
Differential Revision: https://reviews.llvm.org/D27012 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288065 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-21[asan] Store full AddressDescription objects in ErrorInvalidPointerPairFilipe Cabecinhas
Reviewers: kcc, vitalybuka, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24777 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282102 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[asan] Reify ErrorInvalidPointerPairFilipe Cabecinhas
Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24554 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[asan] Reify ErrorODRViolationFilipe Cabecinhas
Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24552 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[asan] Reify ErrorBadParamsToAnnotateContiguousContainerFilipe Cabecinhas
Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24551 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[asan] Reify ErrorStringFunctionSizeOverflowFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24394 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[asan] Reify ErrorStringFunctionMemoryRangesOverlapFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24393 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorSanitizerGetAllocatedSizeNotOwnedFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24392 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorMallocUsableSizeNotOwnedFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24391 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorAllocTypeMismatchFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24390 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorFreeNotMallocedFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24389 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12[asan] Ease dealing with tagged enum ErrorDescription with some macros.Filipe Cabecinhas
Summary: Added a macro to enumerate the (error name, error member name) pairs. This way, when adding an error, we only need to add the pair to one place (plus add its implementation, or course). Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23875 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12[asan] Cleanup: Move tid into ErrorBase, add const to BufferedStackTrace, be ↵Filipe Cabecinhas
consistent in constructor arguments and member order. Summary: As mentioned in D24394, I'm moving tid to ErrorBase, since basically all errors need it. Also mentioned in the same review are other cleanups like adding const to BufferedStackTrace and make sure constructor orders are consistent. Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24455 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08[asan] Reify ErrorDeadlySignalFilipe Cabecinhas
Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23873 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07[asan] Reify ErrorNewDeleteSizeMismatchFilipe Cabecinhas
Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23874 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Remove extra scariness.Clear() call.Filipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280372 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01Clear scariness score when initializing ErrorDoubleFreeFilipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31Fix the use of unitialized value while reporting double free in ASAN.Ivan Krasin
Summary: This is a follow up to https://reviews.llvm.org/rL280201 where this issue was introduced. ASAN tests failed: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/25219/steps/run%20asan%20tests/logs/stdio Reviewers: filcab Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D24109 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31Reify ErrorDoubleFreeFilipe Cabecinhas
Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23717 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30Start reifying error descriptions (Re-do of D23672 supporting VS2013)Filipe Cabecinhas
Summary: @kcc: I know you've accepted the other revision, but since this is a non-trivial change, I'm updating it to show why D24029 would help. This commit sets up the infrastructure to use reified error descriptions, and moves ReportStackOverflow to the new system. After we convert all the errors, we'll be able to simplify ScopedInErrorReport and remove the older debugging mechanism which had some errors partly reified in some way. We'll be able to maintain the external API. ScopedInErrorReport will be able to track one of the reified errors at a time. The purpose of this is so we have its destructor actually print the error and possibly interface with the debugger (will depend on the platform, of course). Reviewers: kcc, samsonov, timurrrr Subscribers: kcc, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24030 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28Revert "Start reifying error descriptions. Second try: Try to appease Visual ↵Filipe Cabecinhas
Studio." This reverts r279931. Will try it with the same Visual Studio version before committing again. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28Start reifying error descriptions. Second try: Try to appease Visual Studio.Filipe Cabecinhas
Summary: This commit sets up the infrastructure to use reified error descriptions, and moves ReportStackOverflow to the new system. After we convert all the errors, we'll be able to simplify ScopedInErrorReport and remove the older debugging mechanism which had some errors partly reified in some way. We'll be able to maintain the external API. ScopedInErrorReport will be able to track one of the reified errors at a time. The purpose of this is so we have its destructor actually print the error and possibly interface with the debugger (will depend on the platform, of course). Reviewers: kcc, samsonov, timurrrr Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23672 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26Revert "Start reifying error descriptions"Filipe Cabecinhas
This reverts r279862 to investigate VS failures. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26Start reifying error descriptionsFilipe Cabecinhas
Summary: This commit sets up the infrastructure to use reified error descriptions, and moves ReportStackOverflow to the new system. After we convert all the errors, we'll be able to simplify ScopedInErrorReport and remove the older debugging mechanism which had some errors partly reified in some way. We'll be able to maintain the external API. ScopedInErrorReport will be able to track one of the reified errors at a time. The purpose of this is so we have its destructor actually print the error and possibly interface with the debugger (will depend on the platform, of course). Reviewers: kcc, samsonov, timurrrr Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23672 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279862 91177308-0d34-0410-b5e6-96231b3b80d8