Re: [PATCH] usb: musb: fix use-after-free in musb_remove()
From: Joshua Crofts
Date: Fri Nov 20 2026 - 09:25:18 EST
On 20-Nov-26 15:11, Greg Kroah-Hartman wrote:
> On Sat, Nov 07, 2026 at 12:46:17PM +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.
>>
>> Reorder the function so that usb_phy_shutdown() is called before
>> musb_platform_exit(), the same way as musb_init_controller() does in the
>> error path.
...
>>
>
> Does not apply to the usb-linus branch, please rebase and resend.
Sorry, rebased patch here:
https://lore.kernel.org/linux-usb/20261120-usb-uaf-fix-v2-1-cc3cb2a38ad5@xxxxxxxxxx
--
Kind regards,
Joshua Crofts