freebsd-skq/sys/net
ru 6b01296394 rn_walktree*() compute the next leaf before applying a function
to current leaves because function may vanish the current node.

If parent RTA_GENMASK route has a clone (a "cloning clone"), an
rn_walktree_from() starting from parent will cause another walk
starting from clone.  If a function is either rt_fixdelete() or
rt_fixchange(), this recursive walk may vanish the leaf that is
remembered by an outer walk (the "next leaf" above), panicing a
system when it resumes with an outer walk.

The following script paniced my single-user mode booted system:

: sysctl net.inet.ip.forwarding=1
: ipfw add 1 allow ip from any to any
: ifconfig lo0 127.1
: route add -net 10 -genmask 255.255.255.0 127.1
: telnet 10.1			# rt_fixchange() panic
: telnet 10.2
: telnet 10.1
: route delete -net 10		# rt_fixdelete() panic

For the time being, avoid these races by disallowing recursive
walks in rt_fixchange() and rt_fixdelete().

Also, make a slight optimization in the rtrequest(RTM_RESOLVE)
case: there is no reason to call rt_fixchange() in this case.

PR:		kern/37606
MFC after:	5 days
2002-12-23 13:12:41 +00:00
..
bpf_compat.h o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} and 2002-12-19 22:58:27 +00:00
bpf_filter.c
bpf.c correct function declarations of stubs used for building w/o device bpf 2002-11-19 02:50:46 +00:00
bpf.h o add support for multiple link types per interface (e.g. 802.11 and Ethernet) 2002-11-14 23:24:13 +00:00
bpfdesc.h o add support for multiple link types per interface (e.g. 802.11 and Ethernet) 2002-11-14 23:24:13 +00:00
bridge.c SMP locking for ifnet list. 2002-12-22 05:35:03 +00:00
bridge.h network interface and link layer changes: 2002-11-15 00:00:15 +00:00
bsd_comp.c Be consistent about functions being static. 2002-10-16 10:45:53 +00:00
ethernet.h general cleanups mostly aimed at improving portability of drivers 2002-11-14 23:28:47 +00:00
fddi.h network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_arc.h s/__attribute__((__packed__))/__packed/g 2002-09-23 06:25:08 +00:00
if_arcsubr.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_arp.h
if_atm.h
if_atmsubr.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_disc.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_dl.h
if_ef.c SMP locking for ifnet list. 2002-12-22 05:35:03 +00:00
if_ethersubr.c o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} and 2002-12-19 22:58:27 +00:00
if_faith.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_fddisubr.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_gif.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_gif.h - after gif_set_tunnel(), psrc/pdst may be null. set IFF_RUNNING accordingly. 2002-10-16 19:49:37 +00:00
if_gre.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_gre.h MFS: recognize gre packets used in the WCCP protocol. 2002-12-07 14:22:05 +00:00
if_ieee80211.h
if_iso88025subr.c Use if_printf(ifp, "blah") instead of 2002-10-21 02:51:56 +00:00
if_llc.h s/__attribute__((__packed__))/__packed/g 2002-09-23 06:25:08 +00:00
if_loop.c Under some circumstances, the loopback interface will allocate a new 2002-12-18 15:34:17 +00:00
if_media.c
if_media.h Add some additional 802.11 media definitions. 2002-07-14 21:58:19 +00:00
if_mib.c
if_mib.h
if_ppp.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_ppp.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_pppvar.h Make ppp(4) devices clonable and unloadable. 2002-08-09 15:30:48 +00:00
if_sl.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_slvar.h sc_lasttime and sc_starttime are time_t's, not long's. 2001-10-27 20:31:24 +00:00
if_sppp.h
if_spppsubr.c Be consistent about functions being static. 2002-10-16 10:45:53 +00:00
if_stf.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_stf.h
if_tap.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_tap.h
if_tapvar.h
if_tun.c network interface and link layer changes: 2002-11-15 00:00:15 +00:00
if_tun.h
if_tunvar.h
if_types.h
if_var.h SMP locking for ifnet list. 2002-12-22 05:35:03 +00:00
if_vlan_var.h o eliminate separate callback interface for h/w tagged input packets; instead 2002-11-14 23:43:16 +00:00
if_vlan.c o eliminate separate callback interface for h/w tagged input packets; instead 2002-11-14 23:43:16 +00:00
if.c SMP locking for ifnet list. 2002-12-22 05:35:03 +00:00
if.h o add IF_*bps macros for netbsd compatibility 2002-11-14 23:16:18 +00:00
intrq.c
intrq.h
iso88025.h use __packed/__aligned rather than GCC-specific __attribute__. 2002-09-23 06:35:33 +00:00
net_osdep.c
net_osdep.h Lock up ifaddr reference counts. 2002-12-18 11:46:59 +00:00
netisr.c Moved netisr code from kern/kern_intr.c to net/netisr.c as threatened in a 2002-09-22 05:56:41 +00:00
netisr.h Slight whitespace cleanup. Whitespace sync to MAC tree. 2002-07-27 19:53:02 +00:00
pfil.c
pfil.h
pfkeyv2.h add definitions for RIPEMD-160 HMAC and Skipjack encryption algorithms, 2002-10-16 02:18:56 +00:00
ppp_comp.h
ppp_deflate.c Be consistent about functions being static. 2002-10-16 10:45:53 +00:00
ppp_defs.h
ppp_tty.c Use if_printf(ifp, "blah") instead of printf("ppp%d: blah", ifp->if_unit). 2002-10-21 03:41:58 +00:00
radix.c o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} and 2002-12-19 22:58:27 +00:00
radix.h o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} and 2002-12-19 22:58:27 +00:00
raw_cb.c o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} and 2002-12-19 22:58:27 +00:00
raw_cb.h
raw_usrreq.c Back out some style changes. They are not urgent, 2002-11-20 19:00:54 +00:00
route.c rn_walktree*() compute the next leaf before applying a function 2002-12-23 13:12:41 +00:00
route.h
rtsock.c SMP locking for ifnet list. 2002-12-22 05:35:03 +00:00
slcompress.c Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
slcompress.h
slip.h
zlib.c Fix instances of macros with improperly parenthasized arguments. 2002-11-09 12:55:07 +00:00
zlib.h