Add comments to sanitizer properties.

Test: n/a
Change-Id: If71bb4683a4ae969670235c51b3f1b3af2073f91
This commit is contained in:
Liz Kammer
2021-06-25 15:19:27 -04:00
parent 4aa48b03ea
commit 75b9b40a56

View File

@@ -160,24 +160,46 @@ func (t SanitizerType) incompatibleWithCfi() bool {
} }
type SanitizeUserProps struct { type SanitizeUserProps struct {
// Prevent use of any sanitizers on this module
Never *bool `android:"arch_variant"` Never *bool `android:"arch_variant"`
// main sanitizers // ASan (Address sanitizer), incompatible with static binaries.
Address *bool `android:"arch_variant"` // Always runs in a diagnostic mode.
Thread *bool `android:"arch_variant"` // Use of address sanitizer disables cfi sanitizer.
// Hwaddress sanitizer takes precedence over this sanitizer.
Address *bool `android:"arch_variant"`
// TSan (Thread sanitizer), incompatible with static binaries and 32 bit architectures.
// Always runs in a diagnostic mode.
// Use of thread sanitizer disables cfi and scudo sanitizers.
// Hwaddress sanitizer takes precedence over this sanitizer.
Thread *bool `android:"arch_variant"`
// HWASan (Hardware Address sanitizer).
// Use of hwasan sanitizer disables cfi, address, thread, and scudo sanitizers.
Hwaddress *bool `android:"arch_variant"` Hwaddress *bool `android:"arch_variant"`
// local sanitizers // Undefined behavior sanitizer
Undefined *bool `android:"arch_variant"` All_undefined *bool `android:"arch_variant"`
All_undefined *bool `android:"arch_variant"` // Subset of undefined behavior sanitizer
Misc_undefined []string `android:"arch_variant"` Undefined *bool `android:"arch_variant"`
Fuzzer *bool `android:"arch_variant"` // List of specific undefined behavior sanitizers to enable
Safestack *bool `android:"arch_variant"` Misc_undefined []string `android:"arch_variant"`
Cfi *bool `android:"arch_variant"` // Fuzzer, incompatible with static binaries.
Integer_overflow *bool `android:"arch_variant"` Fuzzer *bool `android:"arch_variant"`
Scudo *bool `android:"arch_variant"` // safe-stack sanitizer, incompatible with 32-bit architectures.
Scs *bool `android:"arch_variant"` Safestack *bool `android:"arch_variant"`
Memtag_heap *bool `android:"arch_variant"` // cfi sanitizer, incompatible with asan, hwasan, fuzzer, or Darwin
Cfi *bool `android:"arch_variant"`
// signed/unsigned integer overflow sanitizer, incompatible with Darwin.
Integer_overflow *bool `android:"arch_variant"`
// scudo sanitizer, incompatible with asan, hwasan, tsan
// This should not be used in Android 11+ : https://source.android.com/devices/tech/debug/scudo
// deprecated
Scudo *bool `android:"arch_variant"`
// shadow-call-stack sanitizer, only available on arm64
Scs *bool `android:"arch_variant"`
// Memory-tagging, only available on arm64
// if diag.memtag unset or false, enables async memory tagging
Memtag_heap *bool `android:"arch_variant"`
// A modifier for ASAN and HWASAN for write only instrumentation // A modifier for ASAN and HWASAN for write only instrumentation
Writeonly *bool `android:"arch_variant"` Writeonly *bool `android:"arch_variant"`
@@ -186,12 +208,22 @@ type SanitizeUserProps struct {
// Replaces abort() on error with a human-readable error message. // Replaces abort() on error with a human-readable error message.
// Address and Thread sanitizers always run in diagnostic mode. // Address and Thread sanitizers always run in diagnostic mode.
Diag struct { Diag struct {
Undefined *bool `android:"arch_variant"` // Undefined behavior sanitizer, diagnostic mode
Cfi *bool `android:"arch_variant"` Undefined *bool `android:"arch_variant"`
Integer_overflow *bool `android:"arch_variant"` // cfi sanitizer, diagnostic mode, incompatible with asan, hwasan, fuzzer, or Darwin
Memtag_heap *bool `android:"arch_variant"` Cfi *bool `android:"arch_variant"`
Misc_undefined []string `android:"arch_variant"` // signed/unsigned integer overflow sanitizer, diagnostic mode, incompatible with Darwin.
No_recover []string `android:"arch_variant"` Integer_overflow *bool `android:"arch_variant"`
// Memory-tagging, only available on arm64
// requires sanitizer.memtag: true
// if set, enables sync memory tagging
Memtag_heap *bool `android:"arch_variant"`
// List of specific undefined behavior sanitizers to enable in diagnostic mode
Misc_undefined []string `android:"arch_variant"`
// List of sanitizers to pass to -fno-sanitize-recover
// results in only the first detected error for these sanitizers being reported and program then
// exits with a non-zero exit code.
No_recover []string `android:"arch_variant"`
} `android:"arch_variant"` } `android:"arch_variant"`
// Sanitizers to run with flag configuration specified // Sanitizers to run with flag configuration specified
@@ -200,7 +232,9 @@ type SanitizeUserProps struct {
Cfi_assembly_support *bool `android:"arch_variant"` Cfi_assembly_support *bool `android:"arch_variant"`
} `android:"arch_variant"` } `android:"arch_variant"`
// value to pass to -fsanitize-recover= // List of sanitizers to pass to -fsanitize-recover
// allows execution to continue for these sanitizers to detect multiple errors rather than only
// the first one
Recover []string Recover []string
// value to pass to -fsanitize-blacklist // value to pass to -fsanitize-blacklist
@@ -208,9 +242,7 @@ type SanitizeUserProps struct {
} }
type SanitizeProperties struct { type SanitizeProperties struct {
// Enable AddressSanitizer, ThreadSanitizer, UndefinedBehaviorSanitizer, and // Sanitizers are not supported for Fuchsia.
// others. Please see SanitizerUserProps in build/soong/cc/sanitize.go for
// details.
Sanitize SanitizeUserProps `android:"arch_variant"` Sanitize SanitizeUserProps `android:"arch_variant"`
SanitizerEnabled bool `blueprint:"mutated"` SanitizerEnabled bool `blueprint:"mutated"`
SanitizeDep bool `blueprint:"mutated"` SanitizeDep bool `blueprint:"mutated"`