Re: [PATCH v3 net] cnic: Fix use-after-free bugs in cnic_delete_task

From: patchwork-bot+netdevbpf

Date: Thu Sep 18 2025 - 11:00:13 EST


Hello:

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

On Wed, 17 Sep 2025 13:46:02 +0800 you wrote:
> The original code uses cancel_delayed_work() in cnic_cm_stop_bnx2x_hw(),
> which does not guarantee that the delayed work item 'delete_task' has
> fully completed if it was already running. Additionally, the delayed work
> item is cyclic, the flush_workqueue() in cnic_cm_stop_bnx2x_hw() only
> blocks and waits for work items that were already queued to the
> workqueue prior to its invocation. Any work items submitted after
> flush_workqueue() is called are not included in the set of tasks that the
> flush operation awaits. This means that after the cyclic work items have
> finished executing, a delayed work item may still exist in the workqueue.
> This leads to use-after-free scenarios where the cnic_dev is deallocated
> by cnic_free_dev(), while delete_task remains active and attempt to
> dereference cnic_dev in cnic_delete_task().
>
> [...]

Here is the summary with links:
- [v3,net] cnic: Fix use-after-free bugs in cnic_delete_task
https://git.kernel.org/netdev/net/c/cfa7d9b1e3a8

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