[gwp_asan] Use __sanitizer_fast_backtrace on FuchsiaReviewed By: phosek, cryptoad, hctimDifferential Revision: https://reviews.llvm.org/D101407
[GWP-ASan] Add inbuilt options parser.Adds a modified options parser (shamefully pulled from Scudo, whichshamefully pulled it from sanitizer-common) to GWP-ASan. This allowscustomers (Android) to
[GWP-ASan] Add inbuilt options parser.Adds a modified options parser (shamefully pulled from Scudo, whichshamefully pulled it from sanitizer-common) to GWP-ASan. This allowscustomers (Android) to parse options strings in a common way.Depends on D94117.AOSP side of these patches is staged at: - sepolicy (sysprops should only be settable by the shell, in both root and unrooted conditions): https://android-review.googlesource.com/c/platform/system/sepolicy/+/1517238 - zygote updates: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515009 - bionic changes to add `gwp_asan.<process_name>` system property, and GWP_ASAN_OPTIONS environment variable: https://android-review.googlesource.com/c/platform/bionic/+/1514989Reviewed By: eugenisDifferential Revision: https://reviews.llvm.org/D92696
show more ...
[GWP-ASan] Minor refactor of optional components.In preparation for the inbuilt options parser, this is a minor refactorof optional components including: - Putting certain optional elements in th
[GWP-ASan] Minor refactor of optional components.In preparation for the inbuilt options parser, this is a minor refactorof optional components including: - Putting certain optional elements in the right header files, according to their function and their dependencies. - Cleaning up some old and mostly-dead code. - Moving some functions into anonymous namespaces to prevent symbol export.Reviewed By: cryptoad, eugenisDifferential Revision: https://reviews.llvm.org/D94117
[GWP-ASan] Stub out backtrace/signal functions on FuchsiaThe initial version of GWP-ASan on Fuchsia doesn't support crash andsignal handlers, so this just adds empty stubs to be able to compileth
[GWP-ASan] Stub out backtrace/signal functions on FuchsiaThe initial version of GWP-ASan on Fuchsia doesn't support crash andsignal handlers, so this just adds empty stubs to be able to compilethe project on the platform.Differential Revision: https://reviews.llvm.org/D90537
[GWP-ASan] Cleanup (NFC)Cleaning up some of the GWP-ASan code base:- lots of headers didn't have the correct file name- adding `#ifdef` guard to `utilities.h`- correcting an `#ifdef` guard based
[GWP-ASan] Cleanup (NFC)Cleaning up some of the GWP-ASan code base:- lots of headers didn't have the correct file name- adding `#ifdef` guard to `utilities.h`- correcting an `#ifdef` guard based on actual file name- removing an extra `;`- clang-format'ing the code (`-style=llvm`)Differential Revision: https://reviews.llvm.org/D89721
[GWP-ASan] Fix uninitialized memory use in sigaction.Fix up a small bug where we used a partially-uninitialized sigactionstruct in the optional signal handler. Shouldn't be a user-visiblechange.
[GWP-ASan] Split the unwinder into segv/non-segv.Note: Resubmission with frame pointers force-enabled to fix builds with-DCOMPILER_RT_BUILD_BUILTINS=FalseSummary:Splits the unwinder into a non-
[GWP-ASan] Split the unwinder into segv/non-segv.Note: Resubmission with frame pointers force-enabled to fix builds with-DCOMPILER_RT_BUILD_BUILTINS=FalseSummary:Splits the unwinder into a non-segv (for allocation/deallocation traces) and asegv unwinder. This ensures that implementations can select an accurate, slowerunwinder in the segv handler (if they choose to use the GWP-ASan provided one).This is important as fast frame-pointer unwinders (like the sanitizer unwinder)don't like unwinding through signal handlers.Reviewers: morehouse, cryptoadReviewed By: morehouse, cryptoadSubscribers: cryptoad, mgorny, eugenis, pcc, #sanitizersTags: #sanitizersDifferential Revision: https://reviews.llvm.org/D83994
Revert 502f0cc0e38 "[GWP-ASan] Split the unwinder into segv/non-segv."It was causing tests to fail in -DCOMPILER_RT_BUILD_BUILTINS=OFF builds: GwpAsan-Unittest :: ./GwpAsan-x86_64-Test/Backtrac
Revert 502f0cc0e38 "[GWP-ASan] Split the unwinder into segv/non-segv."It was causing tests to fail in -DCOMPILER_RT_BUILD_BUILTINS=OFF builds: GwpAsan-Unittest :: ./GwpAsan-x86_64-Test/BacktraceGuardedPoolAllocator.DoubleFree GwpAsan-Unittest :: ./GwpAsan-x86_64-Test/BacktraceGuardedPoolAllocator.UseAfterFreesee comment on the code review.> Summary:> Splits the unwinder into a non-segv (for allocation/deallocation traces) and a> segv unwinder. This ensures that implementations can select an accurate, slower> unwinder in the segv handler (if they choose to use the GWP-ASan provided one).> This is important as fast frame-pointer unwinders (like the sanitizer unwinder)> don't like unwinding through signal handlers.>> Reviewers: morehouse, cryptoad>> Reviewed By: morehouse, cryptoad>> Subscribers: cryptoad, mgorny, eugenis, pcc, #sanitizers>> Tags: #sanitizers>> Differential Revision: https://reviews.llvm.org/D83994This reverts commit 502f0cc0e3889229e923e187f38dda91324ae139.
[GWP-ASan] Split the unwinder into segv/non-segv.Summary:Splits the unwinder into a non-segv (for allocation/deallocation traces) and asegv unwinder. This ensures that implementations can select
[GWP-ASan] Split the unwinder into segv/non-segv.Summary:Splits the unwinder into a non-segv (for allocation/deallocation traces) and asegv unwinder. This ensures that implementations can select an accurate, slowerunwinder in the segv handler (if they choose to use the GWP-ASan provided one).This is important as fast frame-pointer unwinders (like the sanitizer unwinder)don't like unwinding through signal handlers.Reviewers: morehouse, cryptoadReviewed By: morehouse, cryptoadSubscribers: cryptoad, mgorny, eugenis, pcc, #sanitizersTags: #sanitizersDifferential Revision: https://reviews.llvm.org/D83994
[GWP-ASan] Fix unused variables from crash handler + clang-formatSummary: NFC - See titleReviewers: eugenisReviewed By: eugenisSubscribers: merge_guards_bot, #sanitizers, llvm-commitsTags:
[GWP-ASan] Fix unused variables from crash handler + clang-formatSummary: NFC - See titleReviewers: eugenisReviewed By: eugenisSubscribers: merge_guards_bot, #sanitizers, llvm-commitsTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D74100
[GWP-ASan] Crash Handler API.Summary:Forewarning: This patch looks big in #LOC changed. I promise it's not that bad, it just moves a lot of content from one file to another. I've gone ahead and le
[GWP-ASan] Crash Handler API.Summary:Forewarning: This patch looks big in #LOC changed. I promise it's not that bad, it just moves a lot of content from one file to another. I've gone ahead and left inline comments on Phabricator for sections where this has happened.This patch: 1. Introduces the crash handler API (crash_handler_api.h). 2. Moves information required for out-of-process crash handling into an AllocatorState. This is a trivially-copied POD struct that designed to be recovered from a deceased process, and used by the crash handler to create a GWP-ASan report (along with the other trivially-copied Metadata struct). 3. Implements the crash handler API using the AllocatorState and Metadata. 4. Adds tests for the crash handler. 5. Reimplements the (now optionally linked by the supporting allocator) in-process crash handler (i.e. the segv handler) using the new crash handler API. 6. Minor updates Scudo & Scudo Standalone to fix compatibility. 7. Changed capitalisation of errors (e.g. /s/Use after free/Use After Free).Reviewers: cryptoad, eugenis, jfbReviewed By: eugenisSubscribers: merge_guards_bot, pcc, jfb, dexonsmith, mgorny, cryptoad, #sanitizers, llvm-commitsTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D73557
[GWP-ASan] Split options_parser and backtrace_sanitizer_common.Summary:optional/options_parser and optional/backtrace_sanitizer_common are logicallyseparate components. They both use sanitizer-co
[GWP-ASan] Split options_parser and backtrace_sanitizer_common.Summary:optional/options_parser and optional/backtrace_sanitizer_common are logicallyseparate components. They both use sanitizer-common to power theirfunctionality, but there was an unstated implicit dependency that in order forbacktrace_sanitizer_common to function correctly, one had to also useoptions_parser.This was because options_parser called __sanitizer::InitialiseCommonFlags. Thisis a requirement for backtrace_sanitizer_common to work, as the sanitizerunwinder uses the sanitizer_common flags and will SEGV on a null page ifthey're not initialised correctly.This patch removes this hidden dependency. You can now usebacktrace_sanitizer_common without the requirements of options_parser.This patch also makes the GWP-ASan unit tests only have a soft dependency onsanitizer-common. The unit tests previously explicitly used__sanitizer::Printf, which is now provided undertests/optional/printf_sanitizer_common. This allows Android to build the unittests using their own signal-safe printf().Reviewers: eugenisReviewed By: eugenisSubscribers: srhines, mgorny, #sanitizers, llvm-commits, vlad.tsyrklevich, morehouseTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D66684llvm-svn: 369825
[GWP-ASan] Update backtrace function signature.Summary:Updates the function signature and comments for backtracing (and printingbacktraces). This update brings GWP-ASan in line with future requir
[GWP-ASan] Update backtrace function signature.Summary:Updates the function signature and comments for backtracing (and printingbacktraces). This update brings GWP-ASan in line with future requirements forstack frame compression, wherein the length of the trace is providedexplicitly, rather than relying on nullptr-termination.Reviewers: vlad.tsyrklevichReviewed By: vlad.tsyrklevichSubscribers: #sanitizers, llvm-commits, morehouseTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D66099llvm-svn: 368619
[GWP-ASan] Add generic unwinders and structure backtrace output.Summary:Adds two flavours of generic unwinder and all the supporting cruft. If thesupporting allocator is okay with bringing in san
[GWP-ASan] Add generic unwinders and structure backtrace output.Summary:Adds two flavours of generic unwinder and all the supporting cruft. If thesupporting allocator is okay with bringing in sanitizer_common, they can usethe fast frame-pointer based unwinder from sanitizer_common. Otherwise, we alsoprovide the backtrace() libc-based unwinder as well. Of course, the allocatorcan always specify its own unwinder and unwinder-symbolizer.The slightly changed output format is exemplified in the first comment on thispatch. It now better incorporates backtrace information, and displaysallocation details on the second line.Reviewers: eugenis, vlad.tsyrklevichReviewed By: eugenis, vlad.tsyrklevichSubscribers: srhines, kubamracek, mgorny, cryptoad, #sanitizers, llvm-commits, morehouseTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D63841llvm-svn: 364941
[GWP-ASan] Configuration options [3].Summary:See D60593 for further information.This patch introduces the configuration options for GWP-ASan. In general, we expect the supporting allocator to po
[GWP-ASan] Configuration options [3].Summary:See D60593 for further information.This patch introduces the configuration options for GWP-ASan. In general, we expect the supporting allocator to populate the options struct, and give that to GWP-ASan during initialisation. For allocators that are okay with pulling in sanitizer_common, we also provide an optional parser that populates the gwp_asan::Options struct with values provided in the GWP_ASAN_OPTIONS environment variable.This patch contains very little logic, and all of the testable components (i.e. the optional parser's internal logic) is tested as part of the sanitizer_common testbed.Reviewers: vlad.tsyrklevich, morehouse, jfbReviewed By: morehouseSubscribers: dexonsmith, kubamracek, mgorny, #sanitizers, llvm-commits, vitalybukaTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D62698llvm-svn: 362527