From owner-svn-src-stable-11@freebsd.org Fri Aug 16 21:03:56 2019 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D96A2AEDE0; Fri, 16 Aug 2019 21:03:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 469G5S5ScQz4m1m; Fri, 16 Aug 2019 21:03:56 +0000 (UTC) (envelope-from kevans@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 9D52272FE; Fri, 16 Aug 2019 21:03:56 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7GL3uRM035583; Fri, 16 Aug 2019 21:03:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7GL3uEM035580; Fri, 16 Aug 2019 21:03:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201908162103.x7GL3uEM035580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Aug 2019 21:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r351143 - in stable: 11/sys/dev/oce 11/sys/dev/ral 12/sys/dev/oce 12/sys/dev/ral X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/dev/oce 11/sys/dev/ral 12/sys/dev/oce 12/sys/dev/ral X-SVN-Commit-Revision: 351143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2019 21:03:56 -0000 Author: kevans Date: Fri Aug 16 21:03:55 2019 New Revision: 351143 URL: https://svnweb.freebsd.org/changeset/base/351143 Log: MFC r350630, r350657: static analysis fixes from Haiku r350630: oce(4): potential out of bounds access before vector validation r350657: ral: rt2860: fix wcid2ni access/size issue RT2860_WCID_MAX is supposed to describe the max STA index for wcid2ni, and was instead being used as the size -- off-by-one. rt2860_drain_stats_fifo was range-checking wcid only after accessing out-of-bounds potentially. Modified: stable/11/sys/dev/oce/oce_if.c stable/11/sys/dev/ral/rt2860.c stable/11/sys/dev/ral/rt2860var.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/oce/oce_if.c stable/12/sys/dev/ral/rt2860.c stable/12/sys/dev/ral/rt2860var.h Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/oce/oce_if.c ============================================================================== --- stable/11/sys/dev/oce/oce_if.c Fri Aug 16 21:01:35 2019 (r351142) +++ stable/11/sys/dev/oce/oce_if.c Fri Aug 16 21:03:55 2019 (r351143) @@ -831,11 +831,13 @@ oce_fast_isr(void *arg) static int oce_alloc_intr(POCE_SOFTC sc, int vector, void (*isr) (void *arg, int pending)) { - POCE_INTR_INFO ii = &sc->intrs[vector]; + POCE_INTR_INFO ii; int rc = 0, rr; if (vector >= OCE_MAX_EQ) return (EINVAL); + + ii = &sc->intrs[vector]; /* Set the resource id for the interrupt. * MSIx is vector + 1 for the resource id, Modified: stable/11/sys/dev/ral/rt2860.c ============================================================================== --- stable/11/sys/dev/ral/rt2860.c Fri Aug 16 21:01:35 2019 (r351142) +++ stable/11/sys/dev/ral/rt2860.c Fri Aug 16 21:03:55 2019 (r351143) @@ -1091,10 +1091,12 @@ rt2860_drain_stats_fifo(struct rt2860_softc *sc) DPRINTFN(4, ("tx stat 0x%08x\n", stat)); wcid = (stat >> RT2860_TXQ_WCID_SHIFT) & 0xff; + if (wcid > RT2860_WCID_MAX) + continue; ni = sc->wcid2ni[wcid]; /* if no ACK was requested, no feedback is available */ - if (!(stat & RT2860_TXQ_ACKREQ) || wcid == 0xff || ni == NULL) + if (!(stat & RT2860_TXQ_ACKREQ) || ni == NULL) continue; /* update per-STA AMRR stats */ Modified: stable/11/sys/dev/ral/rt2860var.h ============================================================================== --- stable/11/sys/dev/ral/rt2860var.h Fri Aug 16 21:01:35 2019 (r351142) +++ stable/11/sys/dev/ral/rt2860var.h Fri Aug 16 21:03:55 2019 (r351143) @@ -141,7 +141,7 @@ struct rt2860_softc { #define RT2860_PCIE (1 << 2) #define RT2860_RUNNING (1 << 3) - struct ieee80211_node *wcid2ni[RT2860_WCID_MAX]; + struct ieee80211_node *wcid2ni[RT2860_WCID_MAX + 1]; struct rt2860_tx_ring txq[6]; struct rt2860_rx_ring rxq;