CONFIG_PAGE_EXTENSION Extend memmap on extra space for more information on page
Extend memmap on extra space for more information on page. This could be used for debugging features that need to insert extra field for every page. This extension enables us to save memory by not allocating this extra memory according to boottime configuration.
CONFIG_DEBUG_PAGEALLOC Debug page memory allocations
Unmap pages from the kernel linear mapping after free_pages(). Depending on runtime enablement, this results in a small or large slowdown, but helps to find certain types of memory corruption.
Also, the state of page tracking structures is checked more often as pages are being allocated and freed, as unexpected state changes often happen for same reasons as memory corruption (e.g. double free, use-after-free). The error reports for these checks can be augmented with stack traces of last allocation and freeing of the page, when PAGE_OWNER is also selected and enabled on boot.
For architectures which don't enable ARCH_SUPPORTS_DEBUG_PAGEALLOC, fill the pages with poison patterns after free_pages() and verify the patterns before alloc_pages(). Additionally, this option cannot be enabled in combination with hibernation as that would result in incorrect warnings of memory corruption after a resume because free pages are not saved to the suspend image.
By default this option will have a small overhead, e.g. by not allowing the kernel mapping to be backed by large pages on some architectures. Even bigger overhead comes when the debugging is enabled by DEBUG_PAGEALLOC_ENABLE_DEFAULT or the debug_pagealloc command line parameter.
- Depends on
DEBUG_KERNEL && (!HIBERNATION || ARCH_SUPPORTS_DEBUG_PAGEALLOC && !PPC && !SPARC) - Selects
PAGE_POISONING if DEBUG_KERNEL && (!HIBERNATION || ARCH_SUPPORTS_DEBUG_PAGEALLOC && !PPC && !SPARC) && !ARCH_SUPPORTS_DEBUG_PAGEALLOC
If DEBUG_PAGEALLOC
CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT Enable debug page memory allocations by default?
Enable debug page memory allocations by default? This value can be overridden by debug_pagealloc=off|on.
CONFIG_SLUB_DEBUG Enable SLUB debugging support
SLUB has extensive debug support features. Disabling these can result in significant savings in code size. While /sys/kernel/slab will still exist (with SYSFS enabled), it will not provide e.g. cache validation.
- Depends on
SYSFS && !SLUB_TINY - Selects
STACKDEPOT if SYSFS && !SLUB_TINY &&
If SLUB_DEBUG
CONFIG_SLUB_DEBUG_ON SLUB debugging on by default
Boot with debugging on by default. SLUB boots by default with the runtime debug capabilities switched off. Enabling this is equivalent to specifying the "slab_debug" parameter on boot. There is no support for more fine grained debug control like possible with slab_debug=xxx. SLUB debugging may be switched off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying "slab_debug=-".
- Selects
STACKDEPOT_ALWAYS_INIT if SLUB_DEBUG &&
CONFIG_SLUB_RCU_DEBUG Enable UAF detection in TYPESAFE_BY_RCU caches (for KASAN)
Make SLAB_TYPESAFE_BY_RCU caches behave approximately as if the cache was not marked as SLAB_TYPESAFE_BY_RCU and every caller used kfree_rcu() instead.
This is intended for use in combination with KASAN, to enable KASAN to detect use-after-free accesses in such caches. (KFENCE is able to do that independent of this flag.)
This might degrade performance. Unfortunately this also prevents a very specific bug pattern from triggering (insufficient checks against an object being recycled within the RCU grace period); so this option can be turned off even on KASAN builds, in case you want to test for such a bug.
If you're using this for testing bugs / fuzzing and care about catching all the bugs WAY more than performance, you might want to also turn on CONFIG_RCU_STRICT_GRACE_PERIOD.
WARNING: This is designed as a debugging feature, not a security feature. Objects are sometimes recycled without RCU delay under memory pressure.
If unsure, say N.
- Depends on
SLUB_DEBUG && KASAN
CONFIG_PAGE_OWNER Track page owner
This keeps track of what call chain is the owner of a page, may help to find bare alloc_page(s) leaks. Even if you include this feature on your build, it is disabled in default. You should pass "page_owner=on" to boot parameter in order to enable it. Eats a fair amount of memory if enabled. See tools/mm/page_owner_sort.c for user-space helper.
If unsure, say N.
- Depends on
DEBUG_KERNEL && - Selects
DEBUG_FS if DEBUG_KERNEL && - Selects
STACKTRACE if DEBUG_KERNEL && - Selects
STACKDEPOT if DEBUG_KERNEL && - Selects
PAGE_EXTENSION if DEBUG_KERNEL &&
CONFIG_PAGE_TABLE_CHECK Check for invalid mappings in user page tables
Check that anonymous page is not being mapped twice with read write permissions. Check that anonymous and file pages are not being erroneously shared. Since the checking is performed at the time entries are added and removed to user page tables, leaking, corruption and double mapping problems are detected synchronously.
If unsure say "n".
- Depends on
ARCH_SUPPORTS_PAGE_TABLE_CHECK && EXCLUSIVE_SYSTEM_RAM - Selects
PAGE_EXTENSION if ARCH_SUPPORTS_PAGE_TABLE_CHECK && EXCLUSIVE_SYSTEM_RAM
If PAGE_TABLE_CHECK
CONFIG_PAGE_TABLE_CHECK_ENFORCED Enforce the page table checking by default
Always enable page table checking. By default the page table checking is disabled, and can be optionally enabled via page_table_check=on kernel parameter. This config enforces that page table check is always enabled.
If unsure say "n".
CONFIG_PAGE_POISONING Poison pages after freeing
Fill the pages with poison patterns after free_pages() and verify the patterns before alloc_pages. The filling of the memory helps reduce the risk of information leaks from freed data. This does have a potential performance impact if enabled with the "page_poison=1" kernel boot option.
Note that "poison" here is not the same thing as the "HWPoison" for CONFIG_MEMORY_FAILURE. This is software poisoning only.
If you are only interested in sanitization of freed pages without checking the poison pattern on alloc, you can boot the kernel with "init_on_free=1" instead of enabling this.
If unsure, say N
CONFIG_DEBUG_PAGE_REF Enable tracepoint to track down page reference manipulation
This is a feature to add tracepoint for tracking down page reference manipulation. This tracking is useful to diagnose functional failure due to migration failures caused by page reference mismatches. Be careful when enabling this feature because it adds about 30 KB to the kernel code. However the runtime performance overhead is virtually nil until the tracepoints are actually enabled.
- Depends on
DEBUG_KERNEL && TRACEPOINTS
CONFIG_DEBUG_RODATA_TEST Testcase for the marking rodata read-only
This option enables a testcase for the setting rodata read-only.
- Depends on
STRICT_KERNEL_RWX
CONFIG_PTDUMP_DEBUGFS Export kernel pagetable layout to userspace via debugfs
Say Y here if you want to show the kernel pagetable layout in a debugfs file. This information is only useful for kernel developers who are working in architecture specific areas of the kernel. It is probably not a good idea to enable this feature in a production kernel.
If in doubt, say N.
- Depends on
DEBUG_KERNEL && DEBUG_FS && ARCH_HAS_PTDUMP - Selects
PTDUMP if DEBUG_KERNEL && DEBUG_FS && ARCH_HAS_PTDUMP
CONFIG_HAVE_DEBUG_KMEMLEAK
CONFIG_DEBUG_KMEMLEAK Kernel memory leak detector
Say Y here if you want to enable the memory leak detector. The memory allocation/freeing is traced in a way similar to the Boehm's conservative garbage collector, the difference being that the orphan objects are not freed but only shown in /sys/kernel/debug/kmemleak. Enabling this feature will introduce an overhead to memory allocations. See Documentation/dev-tools/kmemleak.rst for more details.
Enabling SLUB_DEBUG may increase the chances of finding leaks due to the slab objects poisoning.
In order to access the kmemleak file, debugfs needs to be mounted (usually at /sys/kernel/debug).
- Depends on
DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK - Selects
DEBUG_FS if DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK - Selects
STACKTRACE if DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK && - Selects
KALLSYMS if DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK - Selects
CRC32 if DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK - Selects
STACKDEPOT if DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK - Selects
STACKDEPOT_ALWAYS_INIT if DEBUG_KERNEL && HAVE_DEBUG_KMEMLEAK && !DEBUG_KMEMLEAK_DEFAULT_OFF
If DEBUG_KMEMLEAK
CONFIG_DEBUG_KMEMLEAK_MEM_POOL_SIZE Kmemleak memory pool size
Kmemleak must track all the memory allocations to avoid reporting false positives. Since memory may be allocated or freed before kmemleak is fully initialised, use a static pool of metadata objects to track such callbacks. After kmemleak is fully initialised, this memory pool acts as an emergency one if slab allocations fail.
- Range
[200 1000000] if DEBUG_KMEMLEAK
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF Default kmemleak to off
Say Y here to disable kmemleak by default. It can then be enabled on the command line via kmemleak=on.
CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN Enable kmemleak auto scan thread on boot up
Depending on the cpu, kmemleak scan may be cpu intensive and can stall user tasks at times. This option enables/disables automatic kmemleak scan at boot up.
Say N here to disable kmemleak auto scan thread to stop automatic scanning. Disabling this option disables automatic reporting of memory leaks.
If unsure, say Y.
If DEBUG_KMEMLEAK_AUTO_SCAN
CONFIG_DEBUG_KMEMLEAK_VERBOSE Default kmemleak to verbose mode
Say Y here to have kmemleak print unreferenced object details (backtrace, hex dump, address) to dmesg when new memory leaks are detected during automatic scanning. This can also be toggled at runtime via /sys/module/kmemleak/parameters/verbose.
If unsure, say N.
CONFIG_PER_VMA_LOCK_STATS Statistics for per-vma locks
Say Y here to enable success, retry and failure counters of page faults handled under protection of per-vma locks. When enabled, the counters are exposed in /proc/vmstat. This information is useful for kernel developers to evaluate effectiveness of per-vma locks and to identify pathological cases. Counting these events introduces a small overhead in the page fault path.
If in doubt, say N.
CONFIG_MEM_ALLOC_PROFILING Enable memory allocation profiling
Track allocation source code and record total allocation size initiated at that code location. The mechanism can be used to track memory leaks with a low performance and memory impact.
- Depends on
&& PROC_FS - Selects
CODE_TAGGING if && PROC_FS - Selects
PAGE_EXTENSION if && PROC_FS - Selects
SLAB_OBJ_EXT if && PROC_FS
If MEM_ALLOC_PROFILING
CONFIG_MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT Enable memory allocation profiling by default
CONFIG_MEM_ALLOC_PROFILING_DEBUG Memory allocation profiler debugging
Adds warnings with helpful error messages for memory allocation profiling.
- arch/alpha/Kconfig:116
- arch/arc/Kconfig:82
- arch/arm/Kconfig:222
- arch/arm64/Kconfig:331
- arch/csky/Kconfig:163
- arch/hexagon/Kconfig:69
- arch/loongarch/Kconfig:282
- arch/microblaze/Kconfig:81
- arch/mips/Kconfig:3001
- arch/openrisc/Kconfig:68
- arch/parisc/Kconfig:167
- arch/powerpc/Kconfig:101
- arch/riscv/Kconfig:320
- arch/s390/Kconfig:11
- arch/sh/Kconfig:111
- arch/sparc/Kconfig:125
- arch/um/Kconfig:81
- arch/x86/Kconfig:353
- arch/xtensa/Kconfig:91
- arch/alpha/Kconfig:89
- arch/arc/Kconfig:70
- arch/arm/Kconfig:319
- arch/arm64/Kconfig:278
- arch/csky/Kconfig:160
- arch/hexagon/Kconfig:57
- arch/loongarch/Kconfig:787
- arch/m68k/Kconfig:84
- arch/microblaze/Kconfig:93
- arch/mips/Kconfig:3046
- arch/nios2/Kconfig:69
- arch/openrisc/Kconfig:54
- arch/parisc/Kconfig:106
- arch/powerpc/Kconfig:30
- arch/riscv/Kconfig:292
- arch/s390/Kconfig:2
- arch/sh/mm/Kconfig:4
- arch/sparc/Kconfig:140
- arch/um/Kconfig:52
- arch/x86/Kconfig:356
- arch/xtensa/Kconfig:94