Re: [PATCH v2] usb: musb: fix use-after-free in musb_remove()

From: Joshua Crofts

Date: Fri Nov 20 2026 - 09:56:34 EST


On 20-Nov-26 15:51, Johan Hovold wrote:
> On Fri, Nov 20, 2026 at 03:23:14PM +0100, Joshua Crofts wrote:
>> Currently in musb_remove(), musb_platform_exit() drops the PHY refcount
>> before usb_phy_shutdown() is called, causing a use-after-free bug.
>
> This is too strongly worded. There is a potential for a use-after-free
> here but it's extremely unlikely to ever be an issue in practice as the
> phy driver would need to be unloaded by root while they are already
> unbinding the host controller.
>
> Why would root want to do that to themselves?
Okay, if I add the word potentially then it's not too strong.

--
Kind regards,
Joshua Crofts