opnsense-src/sys
Robert Watson 35b260cd69 Rework sofree() logic to take into account a possible race with accept().
Sockets in the listen queues have reference counts of 0, so if the
protocol decides to disconnect the pcb and try to free the socket, this
triggered a race with accept() wherein accept() would bump the reference
count before sofree() had removed the socket from the listen queues,
resulting in a panic in sofree() when it discovered it was freeing a
referenced socket.  This might happen if a RST came in prior to accept()
on a TCP connection.

The fix is two-fold: to expand the coverage of the accept mutex earlier
in sofree() to prevent accept() from grabbing the socket after the "is it
really safe to free" tests, and to expand the logic of the "is it really
safe to free" tests to check that the refcount is still 0 (i.e., we
didn't race).

RELENG_5 candidate.

Much discussion with and work by:	green
Reported by:	Marc UBM Bocklet <ubm at u-boot-man dot de>
Reported by:	Vlad <marchenko at gmail dot com>
2004-10-11 08:11:26 +00:00
..
alpha Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
amd64 Move the code for halting the CPU (acpi_cpu_c1) into machdep files. 2004-10-11 05:39:15 +00:00
arm Add optimized version of the bswap macroes for constants if __OPTIMIZED__ is 2004-10-01 16:55:59 +00:00
boot Back out changes which were introduced to delay mounting root file system. 2004-10-05 11:26:43 +00:00
cam Remove the camnet swi and CAM_PERIPH_NET. It has never been used, and given 2004-10-05 04:22:20 +00:00
coda Do not use devsw() but si_devsw direction. This is still bogus but a 2004-09-23 12:19:24 +00:00
compat Rename thread args to be called "td" rather than "p" to be 2004-10-10 18:34:30 +00:00
conf Forcibly create symlinked headers, otherwise the build process may fail 2004-10-09 13:51:28 +00:00
contrib Add an additional struct inpcb * argument to pfil(9) in order to enable 2004-09-29 04:54:33 +00:00
crypto Use __FBSDID(). 2004-06-14 00:38:54 +00:00
ddb Refactor a bunch of scheduler code to give basically the same behaviour 2004-09-05 02:09:54 +00:00
dev Notify the user when the battery is critically low. In the future, we 2004-10-11 06:18:07 +00:00
doc Experimental support for using doxygen to generate kernel documentation. 2004-07-11 16:13:57 +00:00
fs Rework how we store process times in the kernel such that we always store 2004-10-05 18:51:11 +00:00
gdb Comment-out the debugging printf I left in in case there were some 2004-08-10 19:32:33 +00:00
geom Only do the geometry translations on ad* devices, other devices seems to 2004-10-08 21:27:27 +00:00
gnu Desupport device nodes on EXT2 filesystems. 2004-09-27 20:38:46 +00:00
i4b Kill count device support from config. I've changed the last few 2004-08-30 23:03:58 +00:00
i386 Match surrounding style, not style(msmith). 2004-10-11 05:42:12 +00:00
ia64 Move the code for halting the CPU (acpi_cpu_c1) into machdep files. 2004-10-11 05:39:15 +00:00
isa Introduce a tunable to disable support for Synaptics touchpads. A number of 2004-09-29 23:49:57 +00:00
isofs/cd9660 Hold proper thread count while frobbing drivers ioctl. 2004-09-24 07:24:02 +00:00
kern Rework sofree() logic to take into account a possible race with accept(). 2004-10-11 08:11:26 +00:00
libkern Don't attempt to profile __udivsi3() and friends, as mcount() uses them. 2004-10-01 16:44:08 +00:00
modules Port NetBSD auxio driver. The driver was modified to use led(4) and can 2004-10-09 07:31:03 +00:00
net Assign pointer NULL, not 0. 2004-10-11 07:28:36 +00:00
net80211 Add a new network interface flag, IFF_NEEDSGIANT, which will allow 2004-07-27 23:20:45 +00:00
netatalk Inline umich license from COPYRIGHT to make it clear what license the 2004-08-10 03:23:05 +00:00
netatm Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
netgraph Return 0, not NULL, from a function declared as returning int. 2004-10-09 14:20:18 +00:00
netinet Acquire the send socket buffer lock around tcp_output() activities 2004-10-09 16:48:51 +00:00
netinet6 fixed too delayed routing cache expiry. (tvtohz() converts a time interval to ticks, whereas hzto() converts an absolute time to ticks) 2004-10-06 03:32:26 +00:00
netipsec Remove extraneous SECPOLICY_LOCK_DESTROY calls that cause the mutex to be 2004-10-02 00:19:05 +00:00
netipx Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correct 2004-08-28 15:24:53 +00:00
netkey Merge netipsec/key.c:1.17 into KAME pfkey implementation: 2004-09-30 00:49:55 +00:00
netnatm Constify send and receive space constants in natm. 2004-06-24 03:11:29 +00:00
netncp Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
netsmb Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
nfs Remove advertising clause from University of California Regent's 2004-04-07 05:00:01 +00:00
nfs4client Remove NFS4 vop method vector for devices: we are desupporing device nodes 2004-09-27 20:02:50 +00:00
nfsclient nfsclient/nfs_bio.c has a PHOLD() without a PRELE(). Neither should 2004-10-01 05:01:41 +00:00
nfsserver Convert a mtx_lock(&Giant) to a mtx_unlock(&Giant) in nfsrv_link() to 2004-08-25 16:52:59 +00:00
opencrypto Don't acquire Giant in cryptof_close(), as the code is intended to be 2004-08-10 03:26:17 +00:00
pc98 Add more PnP serial cards support. 2004-10-01 15:58:54 +00:00
pccard Move PNP IDs back into oldcard files 2004-08-13 06:57:31 +00:00
pci Fix sis, bfe and ndis in the same way dc was fixed: 2004-10-08 16:14:42 +00:00
posix4 The sem_timedwait() and ksem_timedwait() functions both 2004-02-03 22:27:03 +00:00
powerpc Add sc_iostart to softc and unbreak the build. 2004-09-27 19:51:58 +00:00
rpc Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-23 18:25:46 +00:00
security Remove the debugging tunable, it was not being used. 2004-09-10 15:14:50 +00:00
sparc64 Flush the register windows before we start changing the context. 2004-10-09 16:42:09 +00:00
sys Revert last commit since it breaks API. 2004-10-10 09:16:48 +00:00
tools Pass doxygen doc comments through to the output. 2004-07-11 16:14:24 +00:00
ufs Fix fsbtodb() for UFS1. This fixes an overflow for file sizes >1 TB, 2004-10-09 20:16:06 +00:00
vm In the previous revision, I did not intend to change the default value 2004-10-09 18:51:32 +00:00
Makefile Add a NO_BOOT knob to prevent building the boot blocks and loader. 2004-08-19 09:54:28 +00:00