1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00
freebsd/sys/netinet6
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
..
dest6.c ANSIfy[1] plus some style cleanup nearby. 2007-07-05 16:23:49 +00:00
frag6.c Space cleanup 2007-07-05 16:29:40 +00:00
icmp6.c Space cleanup 2007-07-05 16:29:40 +00:00
icmp6.h
in6_cksum.c ANSIfy[1] plus some style cleanup nearby. 2007-07-05 16:23:49 +00:00
in6_gif.c Space cleanup 2007-07-05 16:29:40 +00:00
in6_gif.h /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
in6_ifattach.c ANSIfy[1] plus some style cleanup nearby. 2007-07-05 16:23:49 +00:00
in6_ifattach.h sync with KAME regarding NDP 2005-10-21 16:23:01 +00:00
in6_pcb.c Space cleanup 2007-07-05 16:29:40 +00:00
in6_pcb.h Reduce network stack oddness: implement .pru_sockaddr and .pru_peeraddr 2007-05-11 10:20:51 +00:00
in6_proto.c Space cleanup 2007-07-05 16:29:40 +00:00
in6_rmx.c Space cleanup 2007-07-05 16:29:40 +00:00
in6_src.c Space cleanup 2007-07-05 16:29:40 +00:00
in6_var.h fixed memory leak for IPv6 multicast membership information associated 2007-06-02 08:02:36 +00:00
in6.c Space cleanup 2007-07-05 16:29:40 +00:00
in6.h Restore behavior changed with rev. 1.46 and make 2007-07-19 09:16:40 +00:00
ip6_ecn.h /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
ip6_forward.c Space cleanup 2007-07-05 16:29:40 +00:00
ip6_id.c ANSIfy[1] plus some style cleanup nearby. 2007-07-05 16:23:49 +00:00
ip6_input.c Space cleanup 2007-07-05 16:29:40 +00:00
ip6_ipsec.c Rename option IPSEC_FILTERGIF to IPSEC_FILTERTUNNEL. 2007-08-05 16:16:15 +00:00
ip6_ipsec.h Rename option IPSEC_FILTERGIF to IPSEC_FILTERTUNNEL. 2007-08-05 16:16:15 +00:00
ip6_mroute.c Space cleanup 2007-07-05 16:29:40 +00:00
ip6_mroute.h Space cleanup 2007-07-05 16:29:40 +00:00
ip6_output.c Space cleanup 2007-07-05 16:29:40 +00:00
ip6_var.h Space cleanup 2007-07-05 16:29:40 +00:00
ip6.h
ip6protosw.h /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
mld6_var.h sync with KAME regarding NDP 2005-10-21 16:23:01 +00:00
mld6.c Space cleanup 2007-07-05 16:29:40 +00:00
nd6_nbr.c Space cleanup 2007-07-05 16:29:40 +00:00
nd6_rtr.c Space cleanup 2007-07-05 16:29:40 +00:00
nd6.c Close a race when trying to lookup a gateway route in rt_check(). 2007-10-22 19:01:26 +00:00
nd6.h sync with KAME regarding NDP 2005-10-21 16:23:01 +00:00
pim6_var.h Remove public declarations of variables that were forgotten when they were 2005-08-10 07:10:02 +00:00
pim6.h /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
raw_ip6.c Space cleanup 2007-07-05 16:29:40 +00:00
raw_ip6.h /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
route6.c ANSIfy[1] plus some style cleanup nearby. 2007-07-05 16:23:49 +00:00
scope6_var.h scope cleanup. with this change 2005-07-25 12:31:43 +00:00
scope6.c ANSIfy[1] plus some style cleanup nearby. 2007-07-05 16:23:49 +00:00
sctp6_usrreq.c - Incorrect error EAGAIN returned for invalid send on a locked 2007-09-13 10:36:43 +00:00
sctp6_var.h - Incorrect error EAGAIN returned for invalid send on a locked 2007-09-13 10:36:43 +00:00
tcp6_var.h /* -> /*- for license, minor formatting changes, separate for KAME 2005-01-07 02:30:35 +00:00
udp6_usrreq.c Continue UDP/UDPv6 synchronization project: 2007-09-08 08:18:24 +00:00
udp6_var.h Continue effort to align UDPv4 and UDPv6 implementations by merging 2007-07-23 07:58:58 +00:00