From owner-cvs-src-old@FreeBSD.ORG Thu Jun 11 16:55:38 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F41111065670 for ; Thu, 11 Jun 2009 16:55:37 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C5CF78FC18 for ; Thu, 11 Jun 2009 16:55:37 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BGtbWf002850 for ; Thu, 11 Jun 2009 16:55:37 GMT (envelope-from zec@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5BGtbof002849 for cvs-src-old@freebsd.org; Thu, 11 Jun 2009 16:55:37 GMT (envelope-from zec@repoman.freebsd.org) Message-Id: <200906111655.n5BGtbof002849@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to zec@repoman.freebsd.org using -f From: Marko Zec Date: Thu, 11 Jun 2009 16:50:49 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src UPDATING src/sys/netgraph netgraph.h ng_base.c ng_eiface.c ng_ether.c ng_iface.c ng_ip_input.c src/sys/sys proc.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 16:55:38 -0000 zec 2009-06-11 16:50:49 UTC FreeBSD src repository Modified files: . UPDATING sys/netgraph netgraph.h ng_base.c ng_eiface.c ng_ether.c ng_iface.c ng_ip_input.c sys/sys proc.h Log: SVN rev 194012 on 2009-06-11 16:50:49Z by zec Introduce a mechanism for detecting calls from outbound path of the network stack when reentering the inbound path from netgraph, and force queueing of mbufs at the outbound netgraph node. The mechanism relies on two components. First, in netgraph nodes where outbound path of the network stack calls into netgraph, the current thread has to be appropriately marked using the new NG_OUTBOUND_THREAD_REF() macro before proceeding to call further into the netgraph topology, and unmarked using the NG_OUTBOUND_THREAD_UNREF() macro before returning to the caller. Second, netgraph nodes which can potentially reenter the network stack in the inbound path have to mark their inbound hooks using NG_HOOK_SET_TO_INBOUND() macro. The netgraph framework will then detect when there is a danger of a call graph looping back from outbound to inbound path via netgraph, and defer handing off the mbufs to the "inbound" node to a worker thread with a clean stack. In this first pass only the most obvious netgraph nodes have been updated to ensure no outbound to inbound calls can occur. Nodes such as ng_ipfw, ng_gif etc. should be further examined whether a potential for outbound to inbound call looping exists. This commit changes the layout of struct thread, but due to __FreeBSD_version number shortage a version bump has been omitted at this time, nevertheless kernel and modules have to be rebuilt. Reviewed by: julian, rwatson, bz Approved by: julian (mentor) Revision Changes Path 1.617 +4 -0 src/UPDATING 1.83 +31 -2 src/sys/netgraph/netgraph.h 1.175 +5 -1 src/sys/netgraph/ng_base.c 1.48 +3 -0 src/sys/netgraph/ng_eiface.c 1.70 +3 -0 src/sys/netgraph/ng_ether.c 1.60 +4 -2 src/sys/netgraph/ng_iface.c 1.7 +5 -1 src/sys/netgraph/ng_ip_input.c 1.533 +1 -0 src/sys/sys/proc.h