HardenedBSD/sys
Olivier Certner 28391f188c
kern_malloc: Restore working KASAN runtime after free() and zfree() folding
In the zfree() case, the explicit_bzero() calls zero all the allocation,
including the redzone which malloc() has marked as invalid.  So calling
kasan_mark() before those is in fact necessary.

This fixes a crash at boot when 'ldconfig' is run and tries to get
random bytes through getrandom() (relevant part of the stack is
read_random_uio() -> zfree() -> explicit_bzero()) for kernels with KASAN
compiled in.

Approved by:    markj (mentor)
Fixes:		4fab5f0054 ("kern_malloc: fold free and zfree together into one __always_inline func")
MFC after:      10 days
MFC with:       4fab5f0054
Sponsored by:   The FreeBSD Foundation
2024-08-01 22:35:14 +02:00
..
amd64 pmap_growkernel: Use VM_ALLOC_NOFREE when allocating pagetable pages 2024-07-30 17:38:24 +02:00
arm pmap_growkernel: Use VM_ALLOC_NOFREE when allocating pagetable pages 2024-07-30 17:38:24 +02:00
arm64 pmap_growkernel: Use VM_ALLOC_NOFREE when allocating pagetable pages 2024-07-30 17:38:24 +02:00
bsm
cam proc: Remove kernel stack swapping support, part 7 2024-07-29 01:43:49 +00:00
cddl
compat sleepqueue: Remove kernel stack swapping support, part 10 2024-07-29 01:43:59 +00:00
conf kernel: Add new dwarf symbols 2024-07-31 22:23:25 -06:00
contrib
crypto siphash: minor improvements to siphash unit test 2024-07-29 14:44:41 -06:00
ddb
dev Fix enum warnings in qat 2024-07-31 21:31:55 +02:00
dts
fs
gdb
geom
gnu
i386 pmap_growkernel: Use VM_ALLOC_NOFREE when allocating pagetable pages 2024-07-30 17:38:24 +02:00
isa
kern kern_malloc: Restore working KASAN runtime after free() and zfree() folding 2024-08-01 22:35:14 +02:00
kgssapi
libkern
modules vmm: Build with proper ldscript on aarch64 2024-07-31 23:47:13 -06:00
net fibs: Suppress the WARNING message for setups with multiple fibs 2024-08-02 01:48:58 +08:00
net80211
netgraph
netinet Revert "udp: improve handling of cached route" 2024-07-30 11:46:27 +02:00
netinet6 Revert "udp: improve handling of cached route" 2024-07-30 11:46:27 +02:00
netipsec ipsec_offload: indirect two more functions on the ipsec.ko module load 2024-07-30 17:59:49 +03:00
netlink
netpfil pf: allow MLD LR to be sent without state 2024-07-29 19:42:26 +02:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
powerpc pmap_growkernel: Use VM_ALLOC_NOFREE when allocating pagetable pages 2024-07-30 17:38:24 +02:00
riscv riscv: Svpbmt extension support 2024-07-31 12:28:13 -03:00
rpc
security
sys sys: Bump __FreeBSD_version to mark new malloc(9) flags 2024-07-30 17:38:25 +02:00
teken
tests
tools
ufs proc: Remove kernel stack swapping support, part 7 2024-07-29 01:43:49 +00:00
vm vm_page: Fix inconsistent use of VM_NOFREE_IMPORT_ORDER in vm_page_alloc_nofree_domain 2024-07-30 19:25:37 +02:00
x86 x86/xen: use UNUSABLE e820 regions for external mappings 2024-07-30 09:41:17 +02:00
xdr
xen xen: introduce a per-arch scratch mapping ranges 2024-07-30 09:39:38 +02:00
Makefile
README.md

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.

Documentation:

Source code documentation is maintained in a set of man pages, under section 9. These pages are located in share/man/man9, from the top-level of the src tree. Consult intro(9) for an overview of existing pages.

Some additional high-level documentation of the kernel is maintained in the Architecture Handbook.

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(4)
vm virtual memory system
x86 code shared by AMD64 and i386 architectures