38da497a4d
KASAN enables the use of LLVM's AddressSanitizer in the kernel. This feature makes use of compiler instrumentation to validate memory accesses in the kernel and detect several types of bugs, including use-after-frees and out-of-bounds accesses. It is particularly effective when combined with test suites or syzkaller. KASAN has high CPU and memory usage overhead and so is not suited for production environments. The runtime and pmap maintain a shadow of the kernel map to store information about the validity of memory mapped at a given kernel address. The runtime implements a number of functions defined by the compiler ABI. These are prefixed by __asan. The compiler emits calls to __asan_load*() and __asan_store*() around memory accesses, and the runtime consults the shadow map to determine whether a given access is valid. kasan_mark() is called by various kernel allocators to update state in the shadow map. Updates to those allocators will come in subsequent commits. The runtime also defines various interceptors. Some low-level routines are implemented in assembly and are thus not amenable to compiler instrumentation. To handle this, the runtime implements these routines on behalf of the rest of the kernel. The sanitizer implementation validates memory accesses manually before handing off to the real implementation. The sanitizer in a KASAN-configured kernel can be disabled by setting the loader tunable debug.kasan.disable=1. Obtained from: NetBSD MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29416 |
||
---|---|---|
.. | ||
config.mk | ||
dtb.build.mk | ||
dtb.mk | ||
files | ||
files.amd64 | ||
files.arm | ||
files.arm64 | ||
files.i386 | ||
files.mips | ||
files.powerpc | ||
files.riscv | ||
files.x86 | ||
kern.mk | ||
kern.opts.mk | ||
kern.post.mk | ||
kern.pre.mk | ||
kmod_syms_prefix.awk | ||
kmod_syms.awk | ||
kmod.mk | ||
kmod.opts.mk | ||
ldscript.amd64 | ||
ldscript.arm | ||
ldscript.arm64 | ||
ldscript.i386 | ||
ldscript.kmod.amd64 | ||
ldscript.kmod.i386 | ||
ldscript.mips | ||
ldscript.mips.cfe | ||
ldscript.mips.mips64 | ||
ldscript.mips.octeon1 | ||
ldscript.powerpc | ||
ldscript.powerpc64 | ||
ldscript.powerpc64le | ||
ldscript.powerpcspe | ||
ldscript.riscv | ||
Makefile.amd64 | ||
Makefile.arm | ||
Makefile.arm64 | ||
Makefile.i386 | ||
Makefile.mips | ||
Makefile.powerpc | ||
Makefile.riscv | ||
newvers.sh | ||
NOTES | ||
options | ||
options.amd64 | ||
options.arm | ||
options.arm64 | ||
options.i386 | ||
options.mips | ||
options.powerpc | ||
options.riscv | ||
std.nodebug | ||
sysent.mk | ||
systags.sh | ||
WITHOUT_SOURCELESS | ||
WITHOUT_SOURCELESS_HOST | ||
WITHOUT_SOURCELESS_UCODE |