freebsd-dev/sys
John Baldwin 21b415b212 Close a race when trying to lookup a gateway route in rt_check().
Specifically, if two threads were doing concurrent lookups and the existing
gateway was marked down, the the first thread would drop a reference on the
gateway route and then unlock the "root" route while it tried to allocate
a new route.  The second thread could then also drop a reference on the
same gateway route resulting in a reference underflow.  Fix this by
clearing the gateway route pointer after dropping the reference count but
before dropping the lock.  Secondly, in this same case, the second thread
would overwrite the gateway route pointer w/o free'ing a reference to the
route installed by the first thread.  In practice this would probably just
fix a lost reference that would result in a route never being freed.

This fixes panics observed in rt_check() and rtexpunge().

MFC after:	1 week
PR:		kern/112490
Insight from:	mehuljv at yahoo.com
Reviewed by:	ru (found the "not-setting it to NULL" part)
Tested by:	several
2007-10-22 19:01:26 +00:00
..
amd64 Switch over to ULE as the default scheduler for amd64 and i386 2007-10-19 12:30:33 +00:00
arm correct guard variable names. 2007-10-18 05:43:44 +00:00
boot Optimize for size on pc98. It enables to boot a kernel again. 2007-10-15 14:20:24 +00:00
bsm Merge OpenBSM 1.0 alpha 15 changes to src/sys/bsm: 2007-07-22 12:28:13 +00:00
cam Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
cddl Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
compat Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
conf Backout sensors framework. 2007-10-15 20:00:24 +00:00
contrib Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
crypto Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSEC 2007-07-03 12:13:45 +00:00
ddb Print the stack bounds of the thread. 2007-10-16 17:52:59 +00:00
dev Add one of HTC Smartphone/PocketPC device IDs. 2007-10-22 08:28:24 +00:00
fs Fixes to msdosfs dirtyflag related stuff: 2007-10-22 17:43:43 +00:00
gdb Add kdb_cpu_sync_icache(), intended to synchronize instruction 2007-06-09 21:55:17 +00:00
geom Add the freebsd-zfs alias. Both APM and GPT have ZFS partition 2007-10-21 20:02:57 +00:00
gnu Get rid of qaddr_t. 2007-10-16 10:54:55 +00:00
i4b Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
i386 Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
ia64 Set PTE_ACCESSED in the PTE and before inserting it in the VHPT. 2007-10-16 03:20:32 +00:00
isa It seems that some i386 mothermoards either do not implement the 2007-07-27 09:34:42 +00:00
kern Add the full module path name to the kld_file_stat structure 2007-10-22 04:12:57 +00:00
libkern Do not use __XSCALE__ to detect if clz is available, use _ARM_ARCH_5 instead. 2007-10-13 12:05:36 +00:00
modules Add Winchiphead (or Nanjin QinHeng Electronics) USB Serial converter driver. 2007-10-18 10:51:06 +00:00
net Close a race when trying to lookup a gateway route in rt_check(). 2007-10-22 19:01:26 +00:00
net80211 invalidate ic_prevchan when constructing a new channel list 2007-09-18 21:54:27 +00:00
netatalk Mark wire data structures in netatalk as __packed so that they are 2007-06-28 12:54:58 +00:00
netatm Disconnect netatm from the build as it is not MPSAFE and relies on 2007-07-14 21:49:24 +00:00
netgraph Fix build with NETGRAPH_DEBUG. 2007-10-19 20:09:58 +00:00
netinet Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
netinet6 Close a race when trying to lookup a gateway route in rt_check(). 2007-10-22 19:01:26 +00:00
netipsec Fix for an infinite loop in processing ESP, IPv6 packets. 2007-09-12 05:54:53 +00:00
netipx Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
netnatm
netncp Commit 14/14 of sched_lock decomposition. 2007-06-05 00:00:57 +00:00
netsmb Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfs
nfs4client Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfsclient Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
nfsserver Add a -z flag to nfsstat which zeros the NFS statistics after displaying 2007-10-18 16:38:07 +00:00
opencrypto Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
pc98 Spelling fix for interupt -> interrupt 2007-10-12 06:03:46 +00:00
pccard
pci Oops, convert a tsleep() to a msleep() that was missed when adding locking 2007-10-15 16:18:20 +00:00
powerpc Make the PCI code aware of PCI domains (aka PCI segments) so we can 2007-09-30 11:05:18 +00:00
rpc Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which 2007-08-06 14:26:03 +00:00
security Canonicalize naming of local variables for struct ksem and associated 2007-10-21 11:11:07 +00:00
sparc64 - Fix the handling of R_SPARC_OLO10, which is a bit of a special case 2007-10-16 19:17:48 +00:00
sun4v Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
sys Add the full module path name to the kld_file_stat structure 2007-10-22 04:12:57 +00:00
tools
ufs Rename the kthread_xxx (e.g. kthread_create()) calls 2007-10-20 23:23:23 +00:00
vm Correct an error of omission in the reimplementation of the page 2007-10-22 06:23:46 +00:00
Makefile Complete repo-copy and move of Coda from src/sys/coda to src/sys/fs/coda 2007-07-12 21:04:58 +00:00