From owner-cvs-all Mon Dec 23 5:12:43 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 302E237B401; Mon, 23 Dec 2002 05:12:42 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E52DC43EDA; Mon, 23 Dec 2002 05:12:41 -0800 (PST) (envelope-from ru@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBNDCffh094188; Mon, 23 Dec 2002 05:12:41 -0800 (PST) (envelope-from ru@repoman.freebsd.org) Received: (from ru@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBNDCfHv094187; Mon, 23 Dec 2002 05:12:41 -0800 (PST) Message-Id: <200212231312.gBNDCfHv094187@repoman.freebsd.org> From: Ruslan Ermilov Date: Mon, 23 Dec 2002 05:12:41 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/net route.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ru 2002/12/23 05:12:41 PST Modified files: sys/net route.c Log: 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 Revision Changes Path 1.73 +7 -4 src/sys/net/route.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message