From owner-freebsd-current@FreeBSD.ORG Fri Jul 27 14:28:46 2007 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5ADF16A496; Fri, 27 Jul 2007 14:28:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8830613C48D; Fri, 27 Jul 2007 14:28:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 4BD1149603; Fri, 27 Jul 2007 10:28:45 -0400 (EDT) Date: Fri, 27 Jul 2007 15:28:45 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org In-Reply-To: <20070725110221.C83919@fledge.watson.org> Message-ID: <20070727152647.T46637@fledge.watson.org> References: <20070725110221.C83919@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: kris@FreeBSD.org, csjp@FreeBSD.org Subject: Re: Removing NET_NEEDS_GIANT: first patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 14:28:47 -0000 On Wed, 25 Jul 2007, Robert Watson wrote: > Things this patch doesn't do: > > - Address the WITNESS lock order warnings generated when credential rules > are > used with ipfw/pf. These are believed to be annoying but non-harmful, as > deadlocks are no longer reported. This view may be revised if evidence to > the contrary is presented. Kris managed to find a report that one of the post-6.0 hangs involved DIVERT sockets, and sure enough, there is a call to ip_output() without an inpcb pointer, which could cause problems. The attached patch may fix this and another recursion-ish issue involving directly invoking ip_input() rather than indirectly via the netisr. If users of IPDIVERT could give this patch a try and make sure breaks, it could be this resolves the reported issues. Regardless of whether it fixes things, it should probably be committed anyway. Robert N M Watson Computer Laboratory University of Cambridge Index: ip_divert.c =================================================================== RCS file: /data/fbsd-cvs/ncvs/src/sys/netinet/ip_divert.c,v retrieving revision 1.128 diff -u -r1.128 ip_divert.c --- ip_divert.c 11 May 2007 10:20:50 -0000 1.128 +++ ip_divert.c 27 Jul 2007 14:25:09 -0000 @@ -61,6 +61,7 @@ #include #include +#include #include #include @@ -378,7 +379,7 @@ ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST | IP_RAWOUTPUT, - inp->inp_moptions, NULL); + inp->inp_moptions, inp); } INP_UNLOCK(inp); INP_INFO_WUNLOCK(&divcbinfo); @@ -407,7 +408,7 @@ SOCK_UNLOCK(so); #endif /* Send packet to input processing */ - ip_input(m); + netisr_queue(NETISR_IP, m); } return error;