ANDROID: GKI: Enable bounds sanitizer

Bounds sanitizer, a part of UndefinedBehaviorSanitizer (UBSan), inserts
run time bounds checks when accessing structs and arrays of constant
size known at compile time (e.g. in `foo[i]` for `char foo[8]`, `i` will
be checked to be not greater than 8).

The change have been tested to not have measurable performance impact.

Bug: 175004266
Signed-off-by: Elena Petrova <lenaptr@google.com>
Change-Id: Ie02ac1b210eeea05ad9bb0bae4b60660648ae776
This commit is contained in:
Elena Petrova
2021-02-08 09:44:41 +00:00
committed by Alistair Delva
parent e1c4b96f21
commit 5f85626b13
2 changed files with 8 additions and 0 deletions

View File

@@ -615,6 +615,10 @@ CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_HEADERS_INSTALL=y
# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_UBSAN=y
CONFIG_UBSAN_TRAP=y
CONFIG_UBSAN_LOCAL_BOUNDS=y
# CONFIG_UBSAN_MISC is not set
CONFIG_PAGE_OWNER=y
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_MEMORY_INIT=y

View File

@@ -559,6 +559,10 @@ CONFIG_DEBUG_INFO_DWARF4=y
CONFIG_HEADERS_INSTALL=y
# CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
CONFIG_MAGIC_SYSRQ=y
CONFIG_UBSAN=y
CONFIG_UBSAN_TRAP=y
CONFIG_UBSAN_LOCAL_BOUNDS=y
# CONFIG_UBSAN_MISC is not set
CONFIG_PAGE_OWNER=y
CONFIG_DEBUG_STACK_USAGE=y
CONFIG_DEBUG_MEMORY_INIT=y