From owner-svn-src-head@freebsd.org Sat Feb 24 22:34:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E3D3F29110; Sat, 24 Feb 2018 22:34:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1E277B3AE; Sat, 24 Feb 2018 22:34:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECDC12BBE6; Sat, 24 Feb 2018 22:34:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1OMYuZx047404; Sat, 24 Feb 2018 22:34:56 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1OMYupx047403; Sat, 24 Feb 2018 22:34:56 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201802242234.w1OMYupx047403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 24 Feb 2018 22:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329941 - head/sys/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ps3 X-SVN-Commit-Revision: 329941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Feb 2018 22:34:57 -0000 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);