svn commit: r209723 - head/sys/netgraph

Marko Zec zec at FreeBSD.org
Tue Jul 6 12:13:15 UTC 2010


Author: zec
Date: Tue Jul  6 12:13:15 2010
New Revision: 209723
URL: http://svn.freebsd.org/changeset/base/209723

Log:
  Fix a double-free bug which can occur if both bit error rate and packet
  duplication probability are configured on a ng_pipe node.
  
  Submitted by:	Jeffrey Ahrenholtz
  MFC after:	3 days

Modified:
  head/sys/netgraph/ng_pipe.c

Modified: head/sys/netgraph/ng_pipe.c
==============================================================================
--- head/sys/netgraph/ng_pipe.c	Tue Jul  6 10:45:38 2010	(r209722)
+++ head/sys/netgraph/ng_pipe.c	Tue Jul  6 12:13:15 2010	(r209723)
@@ -779,8 +779,9 @@ pipe_dequeue(struct hookinfo *hinfo, str
 		    random() % 100 <= hinfo->cfg.duplicate) {
 			ngp_h = uma_zalloc(ngp_zone, M_NOWAIT);
 			KASSERT(ngp_h != NULL, ("ngp_h zalloc failed (3)"));
-			ngp_h->m = m_dup(m, M_NOWAIT);
-			KASSERT(ngp_h->m != NULL, ("m_dup failed"));
+			m = m_dup(m, M_NOWAIT);
+			KASSERT(m != NULL, ("m_dup failed"));
+			ngp_h->m = m;
 		} else {
 			TAILQ_REMOVE(&ngp_f->packet_head, ngp_h, ngp_link);
 			hinfo->run.qin_frames--;


More information about the svn-src-head mailing list