freebsd-dev/sys/amd64
Mark Johnston a422084abb Add the KMSAN runtime
KMSAN enables the use of LLVM's MemorySanitizer in the kernel.  This
enables precise detection of uses of uninitialized memory.  As with
KASAN, this feature has substantial runtime overhead and is intended to
be used as part of some automated testing regime.

The runtime maintains a pair of shadow maps.  One is used to track the
state of memory in the kernel map at bit-granularity: a bit in the
kernel map is initialized when the corresponding shadow bit is clear,
and is uninitialized otherwise.  The second shadow map stores
information about the origin of uninitialized regions of the kernel map,
simplifying debugging.

KMSAN relies on being able to intercept certain functions which cannot
be instrumented by the compiler.  KMSAN thus implements interceptors
which manually update shadow state and in some cases explicitly check
for uninitialized bytes.  For instance, all calls to copyout() are
subject to such checks.

The runtime exports several functions which can be used to verify the
shadow map for a given buffer.  Helpers provide the same functionality
for a few structures commonly used for I/O, such as CAM CCBs, BIOs and
mbufs.  These are handy when debugging a KMSAN report whose
proximate and root causes are far away from each other.

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2021-08-10 21:27:53 -04:00
..
acpica acpi: Fix a repeated comment typo 2021-07-19 17:19:23 +01:00
amd64 amd64: Define KVA regions for KMSAN shadow maps 2021-08-10 21:27:52 -04:00
cloudabi32 Pass the syscall number to capsicum permission-denied signals 2021-07-16 18:06:44 +01:00
cloudabi64 Pass the syscall number to capsicum permission-denied signals 2021-07-16 18:06:44 +01:00
conf xen/timer: fix amd64 LINT kernel build 2021-08-02 10:33:35 +02:00
ia32 Pass the syscall number to capsicum permission-denied signals 2021-07-16 18:06:44 +01:00
include Add the KMSAN runtime 2021-08-10 21:27:53 -04:00
linux linux(4): Fix gcc buld. 2021-07-29 09:52:33 +03:00
linux32 linux(4): Fix gcc buld. 2021-07-29 09:52:33 +03:00
pci
sgx Convert remaining cap_rights_init users to cap_rights_init_one 2021-01-12 13:16:10 +00:00
vmm vmm: Make iommu ops tables const 2021-08-09 13:28:27 -04:00
Makefile