Generic mode

modulename: generic.ko

configname: CONFIG_KASAN_GENERIC

KASAN mode
└─>Generic mode
In linux kernel since version 4.14.326 (release Date: 2023-09-23)  
Enables generic KASAN mode.

This mode is supported in both GCC and Clang. With GCC it requires
version 8.3.0 or later. Any supported Clang version is compatible,
but detection of out-of-bounds accesses for global variables is
supported only since Clang 11.

This mode consumes about 1/8th of available memory at kernel start
and introduces an overhead of ~x1.5 for the rest of the allocations.
The performance slowdown is ~x3.

For better error detection enable CONFIG_STACKTRACE.

Currently CONFIG_KASAN_GENERIC doesn't work with CONFIG_DEBUG_SLAB
(the resulting kernel does not boot).

source code:
selects
CONFIG_SLUB_DEBUG
CONFIG_CONSTRUCTORS
CONFIG_STACKDEPOT

depends
CONFIG_CC_HAS_KASAN_GENERIC
CONFIG_HAVE_ARCH_KASAN
CONFIG_SLUB
CONFIG_SYSFS or CONFIG_SLAB
NOT CONFIG_DEBUG_SLAB