Re: [PATCH v2 net] net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work

From: patchwork-bot+netdevbpf

Date: Mon Oct 06 2025 - 14:30:26 EST


Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@xxxxxxxxxx>:

On Wed, 1 Oct 2025 09:11:49 +0800 you wrote:
> The origin code calls cancel_delayed_work() in ocelot_stats_deinit()
> to cancel the cyclic delayed work item ocelot->stats_work. However,
> cancel_delayed_work() may fail to cancel the work item if it is already
> executing. While destroy_workqueue() does wait for all pending work items
> in the work queue to complete before destroying the work queue, it cannot
> prevent the delayed work item from being rescheduled within the
> ocelot_check_stats_work() function. This limitation exists because the
> delayed work item is only enqueued into the work queue after its timer
> expires. Before the timer expiration, destroy_workqueue() has no visibility
> of this pending work item. Once the work queue appears empty,
> destroy_workqueue() proceeds with destruction. When the timer eventually
> expires, the delayed work item gets queued again, leading to the following
> warning:
>
> [...]

Here is the summary with links:
- [v2,net] net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work
https://git.kernel.org/netdev/net/c/bc9ea7870796

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html