git: kern: Fix device_delete_child() to detach parent first

Aaron LI aly at crater.dragonflybsd.org
Mon May 11 00:12:27 PDT 2026


commit a5bc46746dc2fd7be6b0f56c51c28b2db64294a0
Author: Aaron LI <aly at aaronly.me>
Date:   Sat May 9 14:33:31 2026 +0800

    kern: Fix device_delete_child() to detach parent first
    
    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().
    
    Obtained-from: FreeBSD (commit: d3bf5efc1ff19b102b176512a66110ec84ac982d)

Summary of changes:
 sys/bus/u4b/controller/ehci_pci.c |  6 ------
 sys/bus/u4b/controller/ohci_pci.c |  6 ------
 sys/bus/u4b/controller/uhci_pci.c |  6 ------
 sys/bus/u4b/controller/xhci_pci.c |  6 ------
 sys/bus/u4b/usb_device.c          |  4 +---
 sys/dev/pccard/pccbb/pccbb.c      | 18 +++---------------
 sys/kern/subr_bus.c               |  8 +++++---
 7 files changed, 9 insertions(+), 45 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a5bc46746dc2fd7be6b0f56c51c28b2db64294a0


-- 
DragonFly BSD source repository


More information about the Commits mailing list