Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2018 22:34:56 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329941 - head/sys/powerpc/ps3
Message-ID:  <201802242234.w1OMYupx047403@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat Feb 24 22:34:56 2018
New Revision: 329941
URL: https://svnweb.freebsd.org/changeset/base/329941

Log:
  Avoid dereferencing random memory when kickstarting DMA.
  
  MFC after: 1 week

Modified:
  head/sys/powerpc/ps3/if_glc.c

Modified: head/sys/powerpc/ps3/if_glc.c
==============================================================================
--- head/sys/powerpc/ps3/if_glc.c	Sat Feb 24 21:28:05 2018	(r329940)
+++ head/sys/powerpc/ps3/if_glc.c	Sat Feb 24 22:34:56 2018	(r329941)
@@ -832,7 +832,8 @@ glc_txintr(struct glc_softc *sc)
 		/* Speculatively (or necessarily) start the TX queue again */
 		error = lv1_net_start_tx_dma(sc->sc_bus, sc->sc_dev,
 		    sc->sc_txdmadesc_phys +
-		    txs->txs_firstdesc*sizeof(struct glc_dmadesc), 0);
+		    ((txs == NULL) ? 0 : txs->txs_firstdesc)*
+		     sizeof(struct glc_dmadesc), 0);
 		if (error != 0)
 			device_printf(sc->sc_self,
 			    "lv1_net_start_tx_dma error: %d\n", error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802242234.w1OMYupx047403>