kern/156978: commit references a PR

dfilter service dfilter at FreeBSD.ORG
Thu Jul 7 20:10:03 UTC 2011


The following reply was made to PR kern/156978; it has been noted by GNATS.

From: dfilter at FreeBSD.ORG (dfilter service)
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: kern/156978: commit references a PR
Date: Thu,  7 Jul 2011 20:02:22 +0000 (UTC)

 Author: thompsa
 Date: Thu Jul  7 20:02:09 2011
 New Revision: 223846
 URL: http://svn.freebsd.org/changeset/base/223846
 
 Log:
   Grab the rlock before checking if our interface is enabled, it could be
   possible to hit a dead pointer when changing interfaces.
   
   PR:		kern/156978
   Submitted by:	Andrew Boyer
   MFC after:	1 week
 
 Modified:
   head/sys/net/if_lagg.c
 
 Modified: head/sys/net/if_lagg.c
 ==============================================================================
 --- head/sys/net/if_lagg.c	Thu Jul  7 18:07:03 2011	(r223845)
 +++ head/sys/net/if_lagg.c	Thu Jul  7 20:02:09 2011	(r223846)
 @@ -1221,14 +1221,15 @@ lagg_input(struct ifnet *ifp, struct mbu
  	struct lagg_softc *sc = lp->lp_softc;
  	struct ifnet *scifp = sc->sc_ifp;
  
 +	LAGG_RLOCK(sc);
  	if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
  	    (lp->lp_flags & LAGG_PORT_DISABLED) ||
  	    sc->sc_proto == LAGG_PROTO_NONE) {
 +		LAGG_RUNLOCK(sc);
  		m_freem(m);
  		return (NULL);
  	}
  
 -	LAGG_RLOCK(sc);
  	ETHER_BPF_MTAP(scifp, m);
  
  	m = (*sc->sc_input)(sc, lp, m);
 _______________________________________________
 svn-src-all at freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"
 


More information about the freebsd-net mailing list