opnsense-src/sys
Kyle Evans 33a3ccfc16 if_tuntap: defer transient destroy_dev() to a taskqueue
We're in the dtor, so we can't destroy it now without deadlocking after
recent changes to make destroy_dev() provide a barrier.  However, we
know there isn't any other dtor to run, so we can go ahead and clean up
our state and just prevent a use-after-free if someone races to open
the device while we're trying to destroy it.  tunopen() now uses the
net epoch to protect against softc release by a concurrent
tun_destroy().

While we're here, allow a destroy operation to proceed if we caught a
signal in cv_wait_sig() but tun_busy dropped to 0 while we were waiting
to acquire the lock.

This was more of an inherent design flaw, rather than a bug in the
below-refed commit.

Reviewed by:	kib, markj

(cherry picked from commit 96c1d8db39dfeea78ea3f27d67649252a39bbf2e)
2025-12-17 21:51:56 -06:00
..
amd64 amd64/vmm.c: Fix an incorrect memory segment check in vm_iommu_{un}map 2025-12-15 16:47:00 +01:00
arm sound: Retire snd_mtx* wrappers 2025-11-28 15:34:49 +01:00
arm64 vmm: Move vm_maxcpu handling into MI code 2025-11-18 14:57:43 +00:00
bsm
cam nda: fix setting of unmappedio flag 2025-11-25 15:59:13 -07:00
cddl stand: Teach the zfs loader about dynamic gang headers 2025-11-13 13:48:59 +00:00
compat linuxkpi: clean up stray pctrie_iter_reset 2025-12-16 21:45:17 -05:00
conf sys: move sys/kern/md[45].c to sys/crypto 2025-11-23 02:12:34 +01:00
contrib ath11k: start making compile some more 2025-12-15 18:09:21 +00:00
crypto sys/crypto: import md5c.c C rewrite 2025-11-23 02:12:35 +01:00
ddb
dev e1000: Don't enable ASPM L1 without L0s 2025-12-11 13:43:26 -07:00
dts
fs devfs: make destroy_dev() a release barrier for cdevpriv destructors runs 2025-12-18 00:05:38 +03:00
gdb
geom geom/zero: Add support for unmapped I/O 2025-12-07 22:20:09 +01:00
gnu
i386 padlock(4)/nehemiah: move i386-only entropy source to MD files 2025-10-29 01:07:37 -07:00
isa sys: Bump non-ISA PNP removal to 16.0 2025-10-28 08:23:15 -04:00
kern devfs: make destroy_dev() a release barrier for cdevpriv destructors runs 2025-12-18 00:05:38 +03:00
kgssapi kgssapi: Remove broken MOD_UNLOAD code 2025-12-09 11:32:09 -05:00
libkern libkern: Avoid a one-byte OOB access in strndup() 2025-12-15 14:09:37 +00:00
modules ath11k: add new files to module Makefile 2025-12-15 18:09:21 +00:00
net if_tuntap: defer transient destroy_dev() to a taskqueue 2025-12-17 21:51:56 -06:00
net80211 wlanstat(8): Follow-ups after moving to /usr/sbin and renaming 2025-10-03 01:19:06 +08:00
netgraph ng_device: add kqueue support 2025-12-01 16:37:57 +00:00
netinet divert: Use CK_SLISTs for the divcb hash table 2025-12-11 17:59:09 +00:00
netinet6 mld6: Properly initialize MLD packet options 2025-11-04 12:46:30 +00:00
netipsec ipsec: Fix typos in references to IPsec's ESP 2025-12-07 20:55:50 +01:00
netlink netlink: plug lock leak in genl_register_family() 2025-11-10 09:36:35 -08:00
netpfil pf: Fix error handling in pf_handle_get_tstats() 2025-12-15 14:10:13 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
powerpc
riscv riscv/pmap: Handle superpages in pmap_extract_and_hold() 2025-12-11 17:59:09 +00:00
rpc sys/rpc: UNIX auth: Do not log on bogus AUTH_SYS messages 2025-10-16 18:57:46 +02:00
security audit(4): Fix a typo in an kernel error message 2025-11-08 21:12:56 +01:00
sys uio.h: Indent struct uio according to style(9) 2025-12-15 17:14:57 +01:00
teken
tests
tools gdb: Fix some PEP 8 violations 2025-12-01 16:37:56 +00:00
ufs ffs_truncate: correct INVARIANTS panic debug output 2025-10-28 02:20:35 -07:00
vm vm_fault: only rely on PG_ZERO when the page was newly allocated 2025-12-15 12:33:11 +02:00
x86 NOTES: Add iwm and iwx 2025-11-20 12:22:34 +01:00
xdr
xen
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