opnsense-src/sys
Mark Johnston ca6cd604c8 kmsan: Use the correct origin bytes in kmsan_check_arg()
Upon discovering a violation kmsan_check_arg() passes a pointer to
function parameter shadow state to kmsan_report_hook().
kmsan_report_hook() uses that address to find the origin cells, assuming
that the passed address belongs to the kernel map.  This has two
problems:
1) Function parameter origin state is also located in TLS, not in the
   origin map, but kmsan_report_hook() doesn't know this.
2) KMSAN TLS for thread0 is statically allocated and thus isn't shadowed
   (because the kernel itself is not shadowed).

These bugs could result in inaccuracies in KMSAN reports, or a page
fault when trying to report a KMSAN violation (which by default panics
the kernel anyway).

Fix the problem by making callers of kmsan_report_hook() provide a
pointer to origin cells.

Sponsored by:	The FreeBSD Foundation
2023-07-27 16:02:03 -04:00
..
amd64 kmsan: Add a comment explaining why KMSAN doesn't shadow above KERNBASE 2023-07-27 16:01:58 -04:00
arm arm/unwind: Check stack pointer boundaries before dereferencing 2023-07-27 15:44:00 -04:00
arm64 arm64 pmap: Eliminate unnecessary TLB invalidations 2023-07-26 00:37:13 -05:00
bsm
cam cam/mmc: Migrate to modern uintXX_t from u_intXX_t 2023-07-24 21:32:57 -06:00
cddl kinst.h: make pointer to probe in kinst_cpu_state const 2023-07-19 19:57:44 +03:00
compat linux(4): Implement xattr syscalls 2023-07-22 14:03:33 +03:00
conf base: Remove support for the VTOC8 partitioning scheme 2023-07-26 13:16:12 +02:00
contrib zfs: set autotrim default to 'off' 2023-07-18 11:20:11 +02:00
crypto ossl: Don't try to initialize the cipher for Chacha20+Poly1305. 2023-06-20 07:53:50 -07:00
ddb ddb: Rework macros to make it easier to add new command tables. 2023-07-05 16:02:01 -07:00
dev gve: Fix Tx tcpdump panic 2023-07-26 22:36:42 -07:00
dts spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
fs fdescfs: add a mount option rdlnk 2023-07-13 04:14:20 +03:00
gdb netgdb: Fix netgdb double ack, print proxy address 2023-05-27 09:34:17 -07:00
geom base: Remove support for the VTOC8 partitioning scheme 2023-07-26 13:16:12 +02:00
gnu spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
i386 linux(4): Regen for xattr syscalls 2023-07-22 14:03:32 +03:00
isa spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
kern kmsan: Use the correct origin bytes in kmsan_check_arg() 2023-07-27 16:02:03 -04:00
kgssapi spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
libkern divmoddi*: Use separate statements instead of the comma operator. 2023-07-07 13:01:19 -07:00
modules base: Remove support for the VTOC8 partitioning scheme 2023-07-26 13:16:12 +02:00
net gif(4): Assert that gif_output() isn't called for EtherIP 2023-07-26 13:14:22 +02:00
net80211 net80211: Radiotap: update for defines 2023-05-20 00:56:21 +00:00
netgraph SPDX: It's spelled 'SPDX-License-Identifier' 2023-05-12 10:44:04 -06:00
netinet tcp: document that conditional fields in tcpcb should be at the end 2023-07-27 09:02:19 +02:00
netinet6 inpcb: do not copy so_options into inp_flags2 2023-07-26 20:35:42 -07:00
netipsec tcp: fix TCP MD5 digest computation for TCP over UDP 2023-06-21 22:48:12 +02:00
netlink netinet[6]: make in[6]_control use ucred instead of td. 2023-07-01 06:52:24 +00:00
netpfil pf: add SCTP NAT support 2023-07-21 12:32:19 +02:00
netsmb spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
nfs Fix panic in nfs bootp/diskless after 0785c323f3. 2023-06-02 12:57:26 -04:00
nfsclient
nfsserver
nlm spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
ofed spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
opencrypto opencrypto: Respect alignment constraints in xor_and_encrypt() 2023-07-27 15:44:52 -04:00
powerpc Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
riscv arm64/riscv pmap: Initialize the pmap's pm_pvchunk field 2023-07-21 23:58:18 -05:00
rpc spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
security mac_ipacl: new MAC policy module to limit jail/vnet IP configuration 2023-07-26 00:07:57 +00:00
sys Revert "killpg(): close a race with fork(), part 2" 2023-07-26 18:12:55 +03:00
teken spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
tests ktest: make ktest work with Netlink loaded as a module. 2023-06-13 06:04:14 +00:00
tools makesyscall: Stop generating $FreeBSD$ 2023-06-09 07:26:24 -06:00
ufs Add diagnostics to fsck_ffs(8) for journaled soft-updates debugging. 2023-07-26 14:50:02 -07:00
vm vm_mmap_object: Update the spelling of true/false 2023-07-27 00:25:53 -05:00
x86 xen: move vcpu_info to common, leave hook for setup 2023-07-21 10:59:12 +02:00
xdr spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
xen xen: move vcpu_info to common, leave hook for setup 2023-07-21 10:59:12 +02:00
Makefile Remove dead code in the cscope target 2022-11-11 15:53:57 +00:00
README.md note that some arch independent code can live in dev (e.g. SMBios) 2023-03-03 01:54:07 -08:00

FreeBSD Kernel Source:

This directory contains the source files and build glue that make up the FreeBSD kernel and its modules, including both original and contributed software.

Kernel configuration files are located in the conf/ subdirectory of each architecture. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries. LINT is a compile-only configuration used to maximize build coverage and detect regressions.

Source Roadmap:

Directory Description
amd64 AMD64 (64-bit x86) architecture support
arm 32-bit ARM architecture support
arm64 64-bit ARM (AArch64) architecture support
cam Common Access Method storage subsystem - cam(4) and ctl(4)
cddl CDDL-licensed optional sources such as DTrace
conf kernel build glue
compat Linux compatibility layer, FreeBSD 32-bit compatibility
contrib 3rd-party imported software such as OpenZFS
crypto crypto drivers
ddb interactive kernel debugger - ddb(4)
fs most filesystems, excluding UFS, NFS, and ZFS
dev device drivers and other arch independent code
gdb kernel remote GDB stub - gdb(4)
geom GEOM framework - geom(4)
i386 i386 (32-bit x86) architecture support
kern main part of the kernel
libkern libc-like and other support functions for kernel use
modules kernel module infrastructure
net core networking code
net80211 wireless networking (IEEE 802.11) - net80211(4)
netgraph graph-based networking subsystem - netgraph(4)
netinet IPv4 protocol implementation - inet(4)
netinet6 IPv6 protocol implementation - inet6(4)
netipsec IPsec protocol implementation - ipsec(4)
netpfil packet filters - ipfw(4), pf(4), and ipfilter(4)
opencrypto OpenCrypto framework - crypto(7)
powerpc PowerPC/POWER (32 and 64-bit) architecture support
riscv 64-bit RISC-V architecture support
security security facilities - audit(4) and mac(4)
sys kernel headers
tests kernel unit tests
ufs Unix File System - ffs(7)
vm virtual memory system
x86 code shared by AMD64 and i386 architectures