svn commit: r231761 - head/sys/netgraph

Gleb Smirnoff glebius at FreeBSD.org
Wed Feb 15 14:29:23 UTC 2012


Author: glebius
Date: Wed Feb 15 14:29:23 2012
New Revision: 231761
URL: http://svn.freebsd.org/changeset/base/231761

Log:
  In ng_bypass() add more protection against potential race
  with ng_rmnode() and its followers.

Modified:
  head/sys/netgraph/ng_base.c

Modified: head/sys/netgraph/ng_base.c
==============================================================================
--- head/sys/netgraph/ng_base.c	Wed Feb 15 14:26:50 2012	(r231760)
+++ head/sys/netgraph/ng_base.c	Wed Feb 15 14:29:23 2012	(r231761)
@@ -1161,6 +1161,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;
 


More information about the svn-src-all mailing list