HomePhabricator

[GWP-ASan] enable/disable and fork support.

Authored by eugenis on Jan 10 2020, 4:01 PM.

Description

[GWP-ASan] enable/disable and fork support.

Summary:

  • Implement enable() and disable() in GWP-ASan.
  • Setup atfork handler.
  • Improve test harness sanity and re-enable GWP-ASan in Scudo.

Scudo_standalone disables embedded GWP-ASan as necessary around fork().
Standalone GWP-ASan sets the atfork handler in init() if asked to. This
requires a working malloc(), therefore GWP-ASan initialization in Scudo
is delayed to the post-init callback.

Test harness changes are about setting up a single global instance of
the GWP-ASan allocator so that pthread_atfork() does not create
dangling pointers.

Test case shamelessly stolen from D72470.

Reviewers: cryptoad, hctim, jfb

Subscribers: mgorny, jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73294

Details

Committed
eugenisJan 24 2020, 1:53 PM
Differential Revision
D73294: [GWP-ASan] enable/disable and fork support.
Parents
rGda8bada93833: [gn build] Port 8a81daaa8b5
Branches
Unknown
Tags
Unknown