svn commit: r208677 - stable/8/sys/dev/sge

Pyun YongHyeon yongari at FreeBSD.org
Mon May 31 22:03:57 UTC 2010


Author: yongari
Date: Mon May 31 22:03:56 2010
New Revision: 208677
URL: http://svn.freebsd.org/changeset/base/208677

Log:
  MFC r208512:
    sge_encap() can sometimes return an error with m_head set to NULL.
    Make sure not to requeue freed mbuf in sge_start_locked(). This
    should fix NULL pointer dereference panic.
  
    Reported by:	Nikolay Denev <ndenev <> gmail dot com>
    Submitted by:	jhb
    Approved by:	re (bz)

Modified:
  stable/8/sys/dev/sge/if_sge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/sge/if_sge.c
==============================================================================
--- stable/8/sys/dev/sge/if_sge.c	Mon May 31 21:57:31 2010	(r208676)
+++ stable/8/sys/dev/sge/if_sge.c	Mon May 31 22:03:56 2010	(r208677)
@@ -1588,7 +1588,8 @@ sge_start_locked(struct ifnet *ifp)
 		if (m_head == NULL)
 			break;
 		if (sge_encap(sc, &m_head)) {
-			IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
+			if (m_head != NULL)
+				IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 			break;
 		}


More information about the svn-src-all mailing list