From owner-svn-src-head@freebsd.org Sat Oct 22 02:11:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52F9C1BEB4; Sat, 22 Oct 2016 02:11:54 +0000 (UTC) (envelope-from jhibbits@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 mx1.freebsd.org (Postfix) with ESMTPS id 84B7FB09; Sat, 22 Oct 2016 02:11:54 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9M2Br4S086292; Sat, 22 Oct 2016 02:11:53 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9M2BrVe086290; Sat, 22 Oct 2016 02:11:53 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201610220211.u9M2BrVe086290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 22 Oct 2016 02:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307763 - head/sys/dev/dpaa X-SVN-Group: head 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.23 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, 22 Oct 2016 02:11:54 -0000 Author: jhibbits Date: Sat Oct 22 02:11:53 2016 New Revision: 307763 URL: https://svnweb.freebsd.org/changeset/base/307763 Log: Initialize the ofw_bus_devinfo on the portals to prevent a crash. If the device tree doesn't contain a cpu-handle field in any bman-portal or qman-portal, it will exit without setting up the devinfo, leaving it uninitialized. This will lead to attempts to free random memory, and ultimately panic. Modified: head/sys/dev/dpaa/bman_fdt.c head/sys/dev/dpaa/qman_fdt.c Modified: head/sys/dev/dpaa/bman_fdt.c ============================================================================== --- head/sys/dev/dpaa/bman_fdt.c Sat Oct 22 01:58:21 2016 (r307762) +++ head/sys/dev/dpaa/bman_fdt.c Sat Oct 22 02:11:53 2016 (r307763) @@ -143,7 +143,7 @@ bman_portals_fdt_attach(device_t dev) ihandle_t cpu; int cpu_num, cpus, intr_rid; struct dpaa_portals_devinfo di; - struct ofw_bus_devinfo ofw_di; + struct ofw_bus_devinfo ofw_di = {}; cpus = 0; sc = device_get_softc(dev); Modified: head/sys/dev/dpaa/qman_fdt.c ============================================================================== --- head/sys/dev/dpaa/qman_fdt.c Sat Oct 22 01:58:21 2016 (r307762) +++ head/sys/dev/dpaa/qman_fdt.c Sat Oct 22 02:11:53 2016 (r307763) @@ -143,7 +143,7 @@ qman_portals_fdt_attach(device_t dev) ihandle_t cpu; int cpu_num, cpus, intr_rid; struct dpaa_portals_devinfo di; - struct ofw_bus_devinfo ofw_di; + struct ofw_bus_devinfo ofw_di = {}; cpus = 0; sc = device_get_softc(dev);