HomeFreeBSD

miibus: Use a bus_child_deleted method to free ivars for children

Description

miibus: Use a bus_child_deleted method to free ivars for children

If a device was detached (e.g. via devctl) and then re-attached, the
ivars would be freed by the previous bus_child_detached method during
detach, but device_get_ivars during the subsequent attach would return
a stale pointer resulting in a use after free.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47371

(cherry picked from commit dc569c894207a524b0cb542040b35b0edd57d1c8)

Details

Provenance
jhbAuthored on Nov 1 2024, 2:10 PM
Reviewer
imp
Differential Revision
D47371: miibus: Use a bus_child_deleted method to free ivars for children
Parents
rGaf26e45173a1: iicbus: Use a bus_child_deleted method to free ivars for children
Branches
Unknown
Tags
Unknown