From owner-svn-src-stable@FreeBSD.ORG Mon Mar 5 17:51:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 943D8106568F; Mon, 5 Mar 2012 17:51:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 833538FC34; Mon, 5 Mar 2012 17:51:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q25Hpwfa097133; Mon, 5 Mar 2012 17:51:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q25HpwTP097131; Mon, 5 Mar 2012 17:51:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201203051751.q25HpwTP097131@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 5 Mar 2012 17:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232556 - stable/8/sys/netgraph 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: Mon, 05 Mar 2012 17:51:58 -0000 Author: glebius Date: Mon Mar 5 17:51:57 2012 New Revision: 232556 URL: http://svn.freebsd.org/changeset/base/232556 Log: Merge r231761 from head: In ng_bypass() add more protection against potential race with ng_rmnode() and its followers. Modified: stable/8/sys/netgraph/ng_base.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netgraph/ng_base.c ============================================================================== --- stable/8/sys/netgraph/ng_base.c Mon Mar 5 17:51:15 2012 (r232555) +++ stable/8/sys/netgraph/ng_base.c Mon Mar 5 17:51:57 2012 (r232556) @@ -1169,6 +1169,10 @@ ng_bypass(hook_p hook1, hook_p hook2) return (EINVAL); } mtx_lock(&ng_topo_mtx); + if (NG_HOOK_NOT_VALID(hook1) || NG_HOOK_NOT_VALID(hook2)) { + mtx_unlock(&ng_topo_mtx); + return (EINVAL); + } hook1->hk_peer->hk_peer = hook2->hk_peer; hook2->hk_peer->hk_peer = hook1->hk_peer;