Backport kfence feature from mainline.
Alexander Potapenko (10): mm: add Kernel Electric-Fence infrastructure x86, kfence: enable KFENCE for x86 mm, kfence: insert KFENCE hooks for SLAB mm, kfence: insert KFENCE hooks for SLUB kfence, kasan: make KFENCE compatible with KASAN tracing: add error_report_end trace point kfence: use error_report_end tracepoint kasan: use error_report_end tracepoint kfence: move the size check to the beginning of __kfence_alloc() kfence: skip all GFP_ZONEMASK allocations
Christophe Leroy (2): powerpc/32s: Always map kernel text and rodata with BATs powerpc: Enable KFENCE for PPC32
Hyeonggon Yoo (1): mm, slub: change run-time assertion in kmalloc_index() to compile-time
Jisheng Zhang (1): arm64: mm: don't use CON and BLK mapping if KFENCE is enabled
Kefeng Wang (3): ARM: mm: Provide set_memory_valid() ARM: mm: Provide is_write_fault() ARM: Support KFENCE for ARM
Marco Elver (22): arm64, kfence: enable KFENCE for ARM64 kfence: use pt_regs to generate stack trace on faults kfence, Documentation: add KFENCE documentation kfence: add test suite MAINTAINERS: add entry for KFENCE kfence: report sensitive information based on no_hash_pointers kfence: fix printk format for ptrdiff_t kfence, slab: fix cache_alloc_debugcheck_after() for bulk allocations kfence: fix reports if constant function prefixes exist kfence: make compatible with kmemleak kfence, x86: fix preemptible warning on KPTI-enabled systems kfence: zero guard page after out-of-bounds access kfence: await for allocation using wait_event kfence: maximize allocation wait timeout duration kfence: use power-efficient work queue to run delayed work kfence: use TASK_IDLE when awaiting allocation kfence: unconditionally use unbound work queue kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE kfence, x86: only define helpers if !MODULE lib/vsprintf: do not show no_hash_pointers message multiple times kfence: test: fail fast if disabled at boot kfence: show cpu and timestamp in alloc/free info
Stephen Boyd (1): slub: force on no_hash_pointers when slub_debug is enabled
Sven Schnelle (1): kfence: add function to mask address bits
Timur Tabi (3): lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers kselftest: add support for skipped tests lib/vsprintf: no_hash_pointers prints all addresses as unhashed
Vlastimil Babka (1): printk: clarify the documentation for plain pointer printing
Weizhao Ouyang (1): kfence: defer kfence_test_init to ensure that kunit debugfs is created
.../admin-guide/kernel-parameters.txt | 15 + Documentation/core-api/printk-formats.rst | 26 +- Documentation/dev-tools/index.rst | 1 + Documentation/dev-tools/kfence.rst | 306 ++++++ MAINTAINERS | 12 + arch/arm/Kconfig | 1 + arch/arm/include/asm/kfence.h | 53 ++ arch/arm/include/asm/set_memory.h | 5 + arch/arm/mm/fault.c | 16 +- arch/arm/mm/pageattr.c | 41 +- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/kfence.h | 22 + arch/arm64/mm/fault.c | 4 + arch/arm64/mm/mmu.c | 11 +- arch/powerpc/Kconfig | 13 +- arch/powerpc/include/asm/kfence.h | 33 + arch/powerpc/kernel/head_book3s_32.S | 4 +- arch/powerpc/mm/book3s32/mmu.c | 8 +- arch/powerpc/mm/fault.c | 7 +- arch/powerpc/mm/init_32.c | 3 + arch/powerpc/mm/mmu_decl.h | 5 + arch/powerpc/mm/nohash/8xx.c | 4 +- arch/x86/Kconfig | 1 + arch/x86/include/asm/kfence.h | 73 ++ arch/x86/mm/fault.c | 6 + include/linux/kernel.h | 2 + include/linux/kfence.h | 223 +++++ include/linux/slab.h | 17 +- include/linux/slab_def.h | 3 + include/linux/slub_def.h | 3 + include/trace/events/error_report.h | 74 ++ init/main.c | 3 + kernel/trace/Makefile | 1 + kernel/trace/error_report-traces.c | 11 + lib/Kconfig.debug | 1 + lib/Kconfig.kfence | 83 ++ lib/test_bitmap.c | 3 +- lib/test_printf.c | 12 +- lib/vsprintf.c | 46 +- mm/Makefile | 1 + mm/kasan/common.c | 18 + mm/kasan/generic.c | 3 +- mm/kasan/report.c | 8 +- mm/kfence/Makefile | 6 + mm/kfence/core.c | 891 ++++++++++++++++++ mm/kfence/kfence.h | 108 +++ mm/kfence/kfence_test.c | 873 +++++++++++++++++ mm/kfence/report.c | 274 ++++++ mm/kmemleak.c | 3 +- mm/slab.c | 41 +- mm/slab_common.c | 12 +- mm/slub.c | 80 +- tools/testing/selftests/kselftest_module.h | 18 +- 53 files changed, 3405 insertions(+), 84 deletions(-) create mode 100644 Documentation/dev-tools/kfence.rst create mode 100644 arch/arm/include/asm/kfence.h create mode 100644 arch/arm64/include/asm/kfence.h create mode 100644 arch/powerpc/include/asm/kfence.h create mode 100644 arch/x86/include/asm/kfence.h create mode 100644 include/linux/kfence.h create mode 100644 include/trace/events/error_report.h create mode 100644 kernel/trace/error_report-traces.c create mode 100644 lib/Kconfig.kfence create mode 100644 mm/kfence/Makefile create mode 100644 mm/kfence/core.c create mode 100644 mm/kfence/kfence.h create mode 100644 mm/kfence/kfence_test.c create mode 100644 mm/kfence/report.c