Re: [PATCH net v2] net: usb: usbnet: fix use-after-free in race on workqueue

From: Jakub Kicinski
Date: Tue Jul 01 2025 - 21:27:36 EST


On Fri, 27 Jun 2025 19:59:53 +0900 Peter GJ. Park wrote:
> When usbnet_disconnect() queued while usbnet_probe() processing,
> it results to free_netdev before kevent gets to run on workqueue,
> thus workqueue does assign_work() with referencing freeed memory address.
>
> For graceful disconnect and to prevent use-after-free of netdev pointer,
> the fix adds canceling work and timer those are placed by usbnet_probe()

Discussion on the v1 thread is ongoing, please repost once it concludes.
--
pw-bot: cr