[GWP-ASan] Add inbuilt options parser.
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Fri, 15 Jan 2021 20:57:00 +0000 (12:57 -0800)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Fri, 15 Jan 2021 20:57:05 +0000 (12:57 -0800)
commit6a42cbf6d2116b52cb59aa3e23bef93a30cf2dc8
treefe26814f3b70b8b81fc7244bd027dcb8c0e818b4
parenta14c36fe27f5c36de44049237011d140a7277774
[GWP-ASan] Add inbuilt options parser.

Adds a modified options parser (shamefully pulled from Scudo, which
shamefully pulled it from sanitizer-common) to GWP-ASan. This allows
customers (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/+/1514989

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D92696
15 files changed:
compiler-rt/lib/gwp_asan/CMakeLists.txt
compiler-rt/lib/gwp_asan/optional/options_parser.cpp
compiler-rt/lib/gwp_asan/optional/options_parser.h
compiler-rt/lib/gwp_asan/options.inc
compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
compiler-rt/lib/gwp_asan/tests/options.cpp [new file with mode: 0644]
compiler-rt/lib/scudo/scudo_allocator.cpp
compiler-rt/lib/scudo/standalone/CMakeLists.txt
compiler-rt/lib/scudo/standalone/combined.h
compiler-rt/lib/scudo/standalone/flags.cpp
compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
compiler-rt/lib/scudo/standalone/tests/flags_test.cpp
compiler-rt/test/scudo/standalone/unit/lit.site.cfg.py.in
compiler-rt/tools/gwp_asan/CMakeLists.txt
compiler-rt/tools/gwp_asan/options_parser_fuzzer.cpp [new file with mode: 0644]