kasan: add option to disable read/write checks
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
cb105192c7
commit
a2df576ecf
|
@ -78,6 +78,14 @@ ifeq ($(CONFIG_MM_KASAN_ALL),y)
|
|||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_READS_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-reads=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_WRITES_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-writes=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_UNWINDER_ARM),y)
|
||||
ARCHOPTIMIZATION += -funwind-tables -fasynchronous-unwind-tables
|
||||
endif
|
||||
|
|
|
@ -230,6 +230,14 @@ ifeq ($(CONFIG_MM_KASAN_ALL),y)
|
|||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_READS_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-reads=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_WRITES_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-writes=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_UBSAN_ALL),y)
|
||||
ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION)
|
||||
endif
|
||||
|
|
|
@ -47,6 +47,14 @@ ifeq ($(CONFIG_MM_KASAN_ALL),y)
|
|||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_READS_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-reads=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_WRITES_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-writes=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_UBSAN_ALL),y)
|
||||
ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION)
|
||||
endif
|
||||
|
|
|
@ -47,6 +47,14 @@ ifeq ($(CONFIG_MM_KASAN_ALL),y)
|
|||
ARCHOPTIMIZATION += -fsanitize=kernel-address
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_READS_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-reads=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_KASAN_DISABLE_WRITES_CHECK),y)
|
||||
ARCHOPTIMIZATION += --param asan-instrument-writes=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MM_UBSAN_ALL),y)
|
||||
ARCHOPTIMIZATION += $(CONFIG_MM_UBSAN_OPTION)
|
||||
endif
|
||||
|
|
17
mm/Kconfig
17
mm/Kconfig
|
@ -265,6 +265,23 @@ config MM_KASAN_ALL
|
|||
to check. Enabling this option will get image size increased
|
||||
and performance decreased significantly.
|
||||
|
||||
config MM_KASAN_DISABLE_READS_CHECK
|
||||
bool "Disable reads check"
|
||||
depends on MM_KASAN
|
||||
default n
|
||||
---help---
|
||||
This option disable kasan reads check. It speeds up performance
|
||||
compared with default read/write check. Only disable it when you are
|
||||
sure there's no need to do so. Or performance is too bad and only focus
|
||||
on writes check.
|
||||
|
||||
config MM_KASAN_DISABLE_WRITES_CHECK
|
||||
bool "Disable writes check"
|
||||
depends on MM_KASAN
|
||||
default n
|
||||
---help---
|
||||
This option disable kasan writes check.
|
||||
|
||||
config MM_UBSAN
|
||||
bool "Undefined Behavior Sanitizer"
|
||||
default n
|
||||
|
|
Loading…
Reference in New Issue