freebsd-skq/sys/conf
Andrew Turner b3c0d957a2 Add support for the Clang Coverage Sanitizer in the kernel (KCOV).
When building with KCOV enabled the compiler will insert function calls
to probes allowing us to trace the execution of the kernel from userspace.
These probes are on function entry (trace-pc) and on comparison operations
(trace-cmp).

Userspace can enable the use of these probes on a single kernel thread with
an ioctl interface. It can allocate space for the probe with KIOSETBUFSIZE,
then mmap the allocated buffer and enable tracing with KIOENABLE, with the
trace mode being passed in as the int argument. When complete KIODISABLE
is used to disable tracing.

The first item in the buffer is the number of trace event that have
happened. Userspace can write 0 to this to reset the tracing, and is
expected to do so on first use.

The format of the buffer depends on the trace mode. When in PC tracing just
the return address of the probe is stored. Under comparison tracing the
comparison type, the two arguments, and the return address are traced. The
former method uses on entry per trace event, while the later uses 4. As
such they are incompatible so only a single mode may be enabled.

KCOV is expected to help fuzzing the kernel, and while in development has
already found a number of issues. It is required for the syzkaller system
call fuzzer [1]. Other kernel fuzzers could also make use of it, either
with the current interface, or by extending it with new modes.

A man page is currently being worked on and is expected to be committed
soon, however having the code in the kernel now is useful for other
developers to use.

[1] https://github.com/google/syzkaller

Submitted by:	Mitchell Horne <mhorne063@gmail.com> (Earlier version)
Reviewed by:	kib
Testing by:	tuexen
Sponsored by:	DARPA, AFRL
Sponsored by:	The FreeBSD Foundation (Mitchell Horne)
Differential Revision:	https://reviews.freebsd.org/D14599
2019-01-12 11:21:28 +00:00
..
config.mk Reduce overhead for simple 'make -V' lookups by avoiding 'find sys/'. 2018-03-10 02:09:36 +00:00
dtb.mk dtb.mk: Fix passing of ECHO to make_dtb{,o}.sh 2018-11-12 17:10:44 +00:00
files Add support for the Clang Coverage Sanitizer in the kernel (KCOV). 2019-01-12 11:21:28 +00:00
files.amd64 Introduce driver for TPM 2.0 in CRB and FIFO (TIS) modes 2018-12-14 16:14:36 +00:00
files.arm amd64: implement memcmp in assembly 2018-09-27 14:05:44 +00:00
files.arm64 mv_thermal: Add thermal driver for AP806 and CP110 thermal sensor 2018-12-12 22:33:05 +00:00
files.i386 Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00
files.mips amd64: implement memcmp in assembly 2018-09-27 14:05:44 +00:00
files.powerpc powerpcspe: Don't require FPU_EMU for powerpcspe IEEE emulation 2018-12-15 04:53:02 +00:00
files.riscv Add support for the UART device found in lowRISC system-on-a-chip. 2018-10-12 15:19:41 +00:00
files.sparc64 Update to Zstandard 1.3.7 2018-10-22 18:29:12 +00:00
kern.mk Remove a use of a negative array index from fxp(4). 2018-12-19 04:54:32 +00:00
kern.opts.mk Now that we've branched, turn off building DRM and DRM2 by default. 2018-10-20 19:18:30 +00:00
kern.post.mk Port the NetBSD ubsan runtime to the FreeBSD kernel. 2018-11-06 17:32:07 +00:00
kern.pre.mk Add support for the Clang Coverage Sanitizer in the kernel (KCOV). 2019-01-12 11:21:28 +00:00
kmod_syms_prefix.awk Add the infrastructure to support loading multiple versions of TCP 2017-06-08 20:41:28 +00:00
kmod_syms.awk
kmod.mk Port the NetBSD ubsan runtime to the FreeBSD kernel. 2018-11-06 17:32:07 +00:00
ldscript.amd64 Add comment to explain kernel ldscript 0x200000 constant 2018-11-09 20:33:38 +00:00
ldscript.arm
ldscript.arm64 Explicitly include all .rodata.* sections in the kernel .rodata. This 2016-09-03 17:23:24 +00:00
ldscript.i386 Fix placement of __bss_start in i386 kernel linker script 2018-10-11 20:44:25 +00:00
ldscript.mips
ldscript.mips.cfe
ldscript.mips.mips64
ldscript.mips.octeon1
ldscript.powerpc
ldscript.powerpc64 powerpc64: Align frequently used/exclusive data on cacheline boundaries 2018-08-19 19:00:44 +00:00
ldscript.powerpcspe Create a new MACHINE_ARCH for Freescale PowerPC e500v2 2016-10-22 01:57:15 +00:00
ldscript.riscv
ldscript.sparc64
Makefile.amd64 Retire CLANG_NO_IAS34 2018-11-01 23:11:47 +00:00
Makefile.arm Only build the cache handling code we need when building the arm ELF 2018-07-28 12:50:09 +00:00
Makefile.arm64 Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.i386 Retire CLANG_NO_IAS34 2018-11-01 23:11:47 +00:00
Makefile.mips Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.powerpc Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.riscv Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
Makefile.sparc64 Revert r336353 completely based on protest; compatibility shims incoming 2018-07-17 14:11:30 +00:00
makeLINT.mk Remove the mlx5 driver from LINT kernel config for 32-bit PPC 2018-05-30 02:26:36 +00:00
makeLINT.sed
newvers.sh Limit git history searches in newvers.sh 2019-01-04 18:38:27 +00:00
NOTES Add NETGRAPH_CHECKSUM. 2018-12-12 19:02:37 +00:00
options Add support for the Clang Coverage Sanitizer in the kernel (KCOV). 2019-01-12 11:21:28 +00:00
options.amd64 Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00
options.arm Remove now the cow unused CPU_ARM9 and CPU_FA526 options. These are for 2018-07-28 11:00:45 +00:00
options.arm64 arm64: Add new SoC type MARVELL_8K 2018-12-12 21:58:30 +00:00
options.i386 Remove iBCS2, part2: general kernel 2018-12-19 21:57:58 +00:00
options.mips Add SMP support for BERI CPU. 2018-04-12 17:43:19 +00:00
options.powerpc Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
options.riscv o Add driver for PLIC (Platform-Level Interrupt Controller) device. 2018-06-12 17:45:15 +00:00
options.sparc64
systags.sh sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE Remove adv(4) and adw(4) 2018-10-22 02:34:47 +00:00