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

From: Johan Hovold

Date: Fri Nov 20 2026 - 09:59:45 EST


On Fri, Nov 20, 2026 at 03:56:19PM +0100, Joshua Crofts wrote:
> 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.

It's a start, but you also should mention that this is not a real issue.

Johan