NULL-deref panic in if_detach when async PHY-probe attach fails (ether_ifdetach on never-attached ifnet)
Summary
uether_ifattach() returns success immediately after queuing ue_attach_post_task asynchronously but if async task mii_phy_probe() fails it goto fails (:239) WITHOUT ever calling ether_ifattach()/if_attach() and WITHOUT recording failure. Driver believes attach succeeded. When device later detached uether_ifdetach() unconditionally calls ether_ifdetach(ifp) (:294) on ifnet never inserted into global ifnetlist so if_detach() TAILQ_REMOVE writes through if_link.tqe_prev==NULL -> reliable kernel panic null-deref write to address 0. Softc zero-allocated M_ZERO so ifp->if_link.{tqe_next tqe_prev} both NULL (if_attach never ran). Affects aue mos udav-PHY drivers. Trigger: USB Ethernet adapter with non-responding PHY then unplug/detach. Impact: reliable local DoS kernel panic.
No comments yet.