freebsd-nq/share/man
Mark Johnston 48d2c7cc30 Add the KASAN runtime
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
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 38da497a4d)
2021-11-01 09:56:31 -04:00
..
man1 pkgbase: move man pages from runtime-manual to runtime 2019-07-19 15:12:20 +00:00
man3 pthread_np.3: Add a manpage summarizing all of the pthread extensions. 2021-10-26 13:59:28 -07:00
man3lua flua: Add a libjail module 2020-10-24 17:08:59 +00:00
man4 Update old iSCSI initiator man pages for removal from 14 and later 2021-10-26 16:23:41 -04:00
man5 Remove 'make update'. 2021-10-19 16:53:24 -07:00
man6 pkgbase: move man pages from runtime-manual to runtime 2019-07-19 15:12:20 +00:00
man7 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. 2021-10-21 14:19:30 -07:00
man8 uefi: Add riscv to historical details 2021-02-24 11:00:13 -07:00
man9 Add the KASAN runtime 2021-11-01 09:56:31 -04:00
Makefile flua: Add a libjail module 2020-10-24 17:08:59 +00:00