@@ -318,124 +318,7 @@ config FS_PROCFS_EXCLUDE_MEMPOOL
318318 default DEFAULT_SMALL
319319 depends on FS_PROCFS && MM_HEAP_MEMPOOL_THRESHOLD > 0
320320
321- config MM_KASAN
322- bool "Kernel Address Sanitizer"
323- default n
324- ---help---
325- KASan is a fast compiler-based tool for detecting memory
326- bugs in native code. After turn on this option, Please
327- add -fsanitize=kernel-address to CFLAGS/CXXFLAGS too.
328-
329- if MM_KASAN
330-
331- choice
332- prompt "KAsan Mode"
333- default MM_KASAN_GENERIC
334-
335- config MM_KASAN_NONE
336- bool "KAsan disable"
337- ---help---
338- Disable KASan check
339-
340- config MM_KASAN_GENERIC
341- bool "KAsan generic mode"
342- ---help---
343- KASan generic mode that does not require hardware support at all
344-
345- config MM_KASAN_SW_TAGS
346- bool "KAsan SW tags"
347- select ARM64_TBI
348- depends on ARCH_ARM64
349- ---help---
350- KAsan based on software tags
351-
352- endchoice
353-
354- config MM_KASAN_ALL
355- bool "Enable KASan for the entire image"
356- default y
357- ---help---
358- This option activates address sanitizer for the entire image.
359- If you don't enable this option, you have to explicitly specify
360- "-fsanitize=kernel-address" for the files/directories you want
361- to check. Enabling this option will get image size increased
362- and performance decreased significantly.
363-
364- config MM_KASAN_REGIONS
365- int "Kasan region count"
366- default 8
367-
368- config MM_KASAN_WATCHPOINT
369- int "Kasan watchpoint maximum number"
370- default 0
371- ---help---
372- The maximum number of watchpoints that can be set by KASan.
373-
374- config MM_KASAN_DISABLE_NULL_POINTER_CHECK
375- bool "Disable null pointer access check"
376- default n
377- ---help---
378- This option enables KASan check null pointer access.
379-
380- config MM_KASAN_DISABLE_READS_CHECK
381- bool "Disable reads check"
382- default n
383- ---help---
384- This option disables kasan reads check. It speeds up performance
385- compared with default read/write check. Only disable it when you are
386- sure there's no need to do so. Or performance is too bad and only focus
387- on writes check.
388-
389- config MM_KASAN_DISABLE_WRITES_CHECK
390- bool "Disable writes check"
391- default n
392- ---help---
393- This option disables kasan writes check.
394-
395- config MM_KASAN_DISABLE_READ_PANIC
396- bool "Disable panic on kasan read error"
397- default n
398- ---help---
399- This option disables panic on kasan read error. It will print error info
400- and continue to run.
401-
402- config MM_KASAN_DISABLE_WRITE_PANIC
403- bool "Disable panic on kasan write error"
404- default n
405- ---help---
406- This option disables panic on kasan write error. It will print error info
407- and continue to run.
408-
409- config MM_KASAN_SKIP_ZERO_TAGS
410- bool "Enable skip check zero tags"
411- default LIBC_MODLIB
412- ---help---
413- This option disables checking for zero tags.
414-
415- config MM_KASAN_GLOBAL
416- bool "Enable global data check"
417- depends on MM_KASAN_ALL
418- default n
419- ---help---
420- This option enables KASan global data check.
421- It's used to extract segments in the linker script.
422- Two new segments need to be created, one being
423- ".kasan.unused: { *(.data..LASANLOC*) }",
424- used to eliminate excess data generated.
425- One is ".kasan.global:{
426- KEEP ( *(. data.. LASAN0))
427- KEEP ( *(. data. rel. local.. LASAN0))
428- }", used to extract data generated by the compiler
429-
430- config MM_KASAN_GLOBAL_ALIGN
431- int "KASan global alignment"
432- default 1
433- depends on MM_KASAN_GLOBAL
434- ---help---
435- It is recommended to use 1, 2, 4, 8, 16, 32.
436- The maximum value is 32.
437-
438- endif # MM_KASAN
321+ source "mm/kasan/Kconfig"
439322
440323config MM_UBSAN
441324 bool "Undefined Behavior Sanitizer"
0 commit comments