freebsd-nq/sys
Fabien Thomas edd0e0b098 The r241129 description was wrong that the scenario is possible
only for read locks on pcbs. The same race can happen with write
lock semantics as well.

The race scenario:

- Two threads (1 and 2) locate pcb with writer semantics (INPLOOKUP_WLOCKPCB)
 and do in_pcbref() on it.
- 1 and 2 both drop the inp hash lock.
- Another thread (3) grabs the inp hash lock. Then it runs in_pcbfree(),
 which wlocks the pcb. They must happen faster than 1 or 2 come INP_WLOCK()!
- 1 and 2 congest in INP_WLOCK().
- 3 does in_pcbremlists(), drops hash lock, and runs in_pcbrele_wlocked(),
 which doesn't free the pcb due to two references on it.
 Then it unlocks the pcb.
- 1 (or 2) gets wlock on the pcb, runs in_pcbrele_wlocked(), which doesn't
 report inp as freed, due to 2 (or 1) still helding extra reference on it.
 The thread tries to do smth with a disconnected pcb and crashes.

Submitted by:	emeric.poupon@stormshield.eu
Reviewed by:	gleb@
MFC after:	1 week
Sponsored by: Stormshield
Tested by: Cassiano Peixoto, Stormshield
2015-11-25 14:45:43 +00:00
..
amd64 Split kerne timekeep ABI structure vdso_sv_tk out of the struct 2015-11-23 07:09:35 +00:00
arm Flush all kernel mappings from TLB(s) in time when they are cleared. 2015-11-24 13:57:41 +00:00
arm64 Add support for moving the DMAP range. This is needed as some AMD SoCs 2015-11-24 11:01:43 +00:00
boot Print more detailed info about the disk and partition chosen for booting. 2015-11-22 20:38:50 +00:00
bsm
cam Add API to obtain primary enclosure name and ID for /dev/sesX devices. 2015-11-21 10:22:01 +00:00
cddl Fix a bug in the amd64 dtrace_getarg() implementation: when unwinding the 2015-11-19 05:33:15 +00:00
compat Split kerne timekeep ABI structure vdso_sv_tk out of the struct 2015-11-23 07:09:35 +00:00
conf Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
contrib Fix inconsistent use of malloc type for cdev private data. 2015-11-23 13:23:53 +00:00
crypto const'ify an arg that we don't update... 2015-07-29 23:37:15 +00:00
ddb Make kstack_pages a tunable on arm, x86, and powepc. On i386, the 2015-08-10 17:18:21 +00:00
dev NTB: WC/WB isn't enough; set MMR region as UC 2015-11-25 01:59:08 +00:00
fs When the nfsd threads are terminated, the NFSv4 server state 2015-11-21 23:55:46 +00:00
gdb
geom Fix early kernel dump via dumpdev env 2015-11-17 20:55:50 +00:00
gnu Fixing a memory leak on module unloading. 2015-09-11 22:43:35 +00:00
i386 Split kerne timekeep ABI structure vdso_sv_tk out of the struct 2015-11-23 07:09:35 +00:00
isa
kern Check that hhk_helper pointer isn't NULL before access. 2015-11-25 07:14:58 +00:00
kgssapi
libkern libkern: ffs, fls: s/4/3/ the 3rd BSD clause 2015-10-22 21:04:47 +00:00
mips Revert r291142. 2015-11-23 11:19:00 +00:00
modules Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
net Fix the build. 2015-11-25 11:31:07 +00:00
net80211 net80211: add ieee80211_restart_all() call. 2015-10-27 20:40:57 +00:00
netgraph Move iflladdr_event eventhandler invocation to if_setlladdr. 2015-11-14 13:34:03 +00:00
netinet The r241129 description was wrong that the scenario is possible 2015-11-25 14:45:43 +00:00
netinet6 Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
netipsec Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
netnatm
netpfil Add destroy_object callback to object rewriting framework. 2015-11-23 22:06:55 +00:00
netsmb The problem report was for a crash that happened when smbfs was 2015-11-18 23:04:01 +00:00
nfs Wait up to 10 seconds for late-initializing network interfaces to arrive. 2015-09-26 13:55:55 +00:00
nfsclient
nfsserver
nlm
ofed Add some defines needed by the coming mlx5 infiniband support. 2015-11-24 12:11:56 +00:00
opencrypto Remove unneeded includes of opt_kdtrace.h. 2015-11-22 02:01:01 +00:00
pc98 Remove compatibility shims for legacy ATA device names. 2015-10-11 13:01:51 +00:00
powerpc Use what we really mean (powerpc_lwsync()) rather than the Linux-compat 2015-11-24 16:10:21 +00:00
rpc Improve locking of sg_threadcount. 2015-11-19 08:04:05 +00:00
security fd: make 'rights' a manadatory argument to fget* functions 2015-07-05 19:05:16 +00:00
sparc64 Merge from r290547: 2015-11-21 02:49:33 +00:00
sys Overhaul if_enc(4) and make it loadable in run-time. 2015-11-25 07:31:59 +00:00
teken Sync HPA and VPA implementations with CUP. 2015-08-24 07:49:27 +00:00
tests Style 9 changes. 2015-11-12 10:31:14 +00:00
tools Rename the /usr/share/doc/legal files to driver.LICENSE to work around 2015-10-16 00:38:05 +00:00
ufs Do not perform read-ahead for BA_CLRBUF request when we are low on 2015-10-27 13:44:13 +00:00
vm Record proper commit message for r291157. 2015-11-22 09:50:13 +00:00
x86 Correct the number of DTLB entries reported for the CPUID Leaf 2 2015-11-24 19:55:11 +00:00
xdr
xen xen/intr: fix the event channel enabled per-cpu mask 2015-11-05 14:33:46 +00:00
Makefile