mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ANDROID: gki_defconfig: enable CONFIG_KASAN_HW_TAGS
Enable in-kernel MTE (Memory Tagging Extension) support via CONFIG_KASAN_HW_TAGS=y. With this change in-kernel MTE will be auto-enabled during boot on hardware that supports MTE. Currently, in-kernel MTE is only supported for slab and page_alloc allocations. Future changes might include support for vmalloc, stack, and globals. By default: - MTE works in synchronous mode, which means that tag faults are being reported at the point of occurence. - When a tag fault is detected, a report is printed into the kernel log. Only the first tag fault gets reported. No panic occurs unless either "kasan.fault=panic" or "panic_on_warn" is set via command line. - A report contains the address and a stack trace of the access. There are no alloc/free stack traces for the accessed page or slab object (as specified via CONFIG_CMDLINE in this change). These defaults can be overridden via command line parameters, see Documentation/dev-tools/kasan.rst for details. In particular, using the "kasan=off" command line parameter will turn in-kernel MTE off. Note, that enabling alloc/free stacktraces requires specifying both "kasan.stacktrace=on" and "stack_depot_disable=off". On MTE-enabled hardware, a performance impact of ~10% is expected, but there is no such hardware yet to run benchmarks. A future integration of in-kernel MTE with init_on_alloc/free might significantly bring down the perfomance impact. There is no performance impact when in-kernel MTE is disabled via command line or when hardware without MTE (pre-ARMv8.5) is in use. There is still a side-effect of TTBR1 TBI (Top Byte Ignore) getting enabled with CONFIG_KASAN_HW_TAGS=y. Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Bug: 172318110 Change-Id: I2f9bb845ae43292c182532e5e42f43e07b4d0d56
This commit is contained in:
@@ -57,7 +57,7 @@ CONFIG_CP15_BARRIER_EMULATION=y
|
||||
CONFIG_SETEND_EMULATION=y
|
||||
CONFIG_RANDOMIZE_BASE=y
|
||||
# CONFIG_RANDOMIZE_MODULE_REGION_FULL is not set
|
||||
CONFIG_CMDLINE="stack_depot_disable=on"
|
||||
CONFIG_CMDLINE="stack_depot_disable=on kasan.stacktrace=off"
|
||||
CONFIG_CMDLINE_EXTEND=y
|
||||
# CONFIG_DMI is not set
|
||||
CONFIG_PM_WAKELOCKS=y
|
||||
@@ -602,6 +602,8 @@ CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_PAGE_OWNER=y
|
||||
CONFIG_DEBUG_STACK_USAGE=y
|
||||
CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_KASAN=y
|
||||
CONFIG_KASAN_HW_TAGS=y
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
CONFIG_PANIC_TIMEOUT=-1
|
||||
CONFIG_SOFTLOCKUP_DETECTOR=y
|
||||
|
||||
Reference in New Issue
Block a user