From owner-svn-src-stable@FreeBSD.ORG Fri Apr 10 11:08:28 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B24E106566C; Fri, 10 Apr 2009 11:08:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03BC48FC1A; Fri, 10 Apr 2009 11:08:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3AB8Rha046823; Fri, 10 Apr 2009 11:08:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3AB8RIg046822; Fri, 10 Apr 2009 11:08:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200904101108.n3AB8RIg046822@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 10 Apr 2009 11:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190890 - stable/6/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 11:08:29 -0000 Author: bz Date: Fri Apr 10 11:08:27 2009 New Revision: 190890 URL: http://svn.freebsd.org/changeset/base/190890 Log: Fix a locking bug introduced in r190369 - add a missing unlock operation on the pcbinfo. Also porperly protect the inp before releasing the lock as in 6.x inps can possibly become invalid at that point. [1] PR: kern/133415 PR: kern/133445 Tested by: eugen kuzbass.ru (Eugene Grosbein) Discussed with: rwatson [1] Pointy hat: obrien Modified: stable/6/sys/netinet/ip_output.c Modified: stable/6/sys/netinet/ip_output.c ============================================================================== --- stable/6/sys/netinet/ip_output.c Fri Apr 10 10:59:48 2009 (r190889) +++ stable/6/sys/netinet/ip_output.c Fri Apr 10 11:08:27 2009 (r190890) @@ -1376,7 +1376,10 @@ ip_ctloutput_pcbinfo(so, sopt, pcbinfo) error = EINVAL; break; } + INP_LOCK(inp); + INP_INFO_WUNLOCK(pcbinfo); error = ipsec4_set_policy(inp, optname, req, len, priv); + INP_UNLOCK(inp); m_freem(m); break; }