From owner-svn-src-head@freebsd.org Mon Oct 17 18:20:07 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 AEDBAC1606E; Mon, 17 Oct 2016 18:20:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAC812F6; Mon, 17 Oct 2016 18:20:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id A8F6C10AF92; Mon, 17 Oct 2016 14:20:06 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307518 - in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/samsung/exynos arm/ti/am335x arm/ti/usb arm/xilinx boot/kshim dev/bhnd/cores/usb dev/puc dev/usb dev/usb/controller ... Date: Mon, 17 Oct 2016 10:27:21 -0700 Message-ID: <1894111.JRI62yHUp5@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201610171020.u9HAKdWO076718@repo.freebsd.org> References: <201610171020.u9HAKdWO076718@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 17 Oct 2016 14:20:06 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean 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: Mon, 17 Oct 2016 18:20:07 -0000 On Monday, October 17, 2016 10:20:39 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Oct 17 10:20:38 2016 > New Revision: 307518 > URL: https://svnweb.freebsd.org/changeset/base/307518 > > Log: > Fix device delete child function. > > When detaching device trees parent devices must be detached prior to > detaching its children. This is because parent devices can have > pointers to the child devices in their softcs which are not > invalidated by device_delete_child(). This can cause use after free > issues and panic(). > > Device drivers implementing trees, must ensure its detach function > detaches or deletes all its children before returning. > > While at it remove now redundant device_detach() calls before > device_delete_child() and device_delete_children(), mostly in > the USB controller drivers. > > Tested by: Jan Henrik Sylvester > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D8070 > MFC after: 2 weeks Thanks. -- John Baldwin