nuttx/mm/kasan/Kconfig
chao an 52482219c8 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:22 +08:00

129 lines
3.3 KiB
Text

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config MM_KASAN
bool "Kernel Address Sanitizer"
default n
---help---
KASan is a fast compiler-based tool for detecting memory
bugs in native code. After turn on this option, Please
add -fsanitize=kernel-address to CFLAGS/CXXFLAGS too.
config MM_KASAN_INSTRUMENT
bool
if MM_KASAN
choice
prompt "KAsan Mode"
default MM_KASAN_GENERIC
config MM_KASAN_NONE
bool "KAsan disable"
---help---
Disable KASan check
config MM_KASAN_GENERIC
bool "KAsan generic mode"
select MM_KASAN_INSTRUMENT
---help---
KASan generic mode that does not require hardware support at all
config MM_KASAN_SW_TAGS
bool "KAsan SW tags"
select ARM64_TBI
select MM_KASAN_INSTRUMENT
depends on ARCH_ARM64
---help---
KAsan based on software tags
endchoice # KAsan Mode
config MM_KASAN_INSTRUMENT_ALL
bool "Enable KASan for the entire image"
depends on MM_KASAN_INSTRUMENT
default y
---help---
This option activates address sanitizer for the entire image.
If you don't enable this option, you have to explicitly specify
"-fsanitize=kernel-address" for the files/directories you want
to check. Enabling this option will get image size increased
and performance decreased significantly.
config MM_KASAN_REGIONS
int "Kasan region count"
default 8
config MM_KASAN_WATCHPOINT
int "Kasan watchpoint maximum number"
default 0
---help---
The maximum number of watchpoints that can be set by KASan.
config MM_KASAN_DISABLE_NULL_POINTER_CHECK
bool "Disable null pointer access check"
default n
---help---
This option enables KASan check null pointer access.
config MM_KASAN_DISABLE_READS_CHECK
bool "Disable reads check"
default n
---help---
This option disables 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"
default n
---help---
This option disables kasan writes check.
config MM_KASAN_DISABLE_READ_PANIC
bool "Disable panic on kasan read error"
default n
---help---
This option disables panic on kasan read error. It will print error info
and continue to run.
config MM_KASAN_DISABLE_WRITE_PANIC
bool "Disable panic on kasan write error"
default n
---help---
This option disables panic on kasan write error. It will print error info
and continue to run.
config MM_KASAN_SKIP_ZERO_TAGS
bool "Enable skip check zero tags"
default LIBC_ELF
---help---
This option disables checking for zero tags.
config MM_KASAN_GLOBAL
bool "Enable global data check"
depends on MM_KASAN_INSTRUMENT_ALL
default n
---help---
This option enables KASan global data check.
It's used to extract segments in the linker script.
Two new segments need to be created, one being
".kasan.unused: { *(.data..LASANLOC*) }",
used to eliminate excess data generated.
One is ".kasan.global:{
KEEP ( *(. data.. LASAN0))
KEEP ( *(. data. rel. local.. LASAN0))
}", used to extract data generated by the compiler
config MM_KASAN_GLOBAL_ALIGN
int "KASan global alignment"
default 1
depends on MM_KASAN_GLOBAL
---help---
It is recommended to use 1, 2, 4, 8, 16, 32.
The maximum value is 32.
endif # MM_KASAN