Date: Mon, 5 Mar 2012 17:51:58 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r232556 - stable/8/sys/netgraph Message-ID: <201203051751.q25HpwTP097131@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203051751.q25HpwTP097131>