Re: [PATCH net v2 1/2] net: wwan: iosm: cancel the ADB timer on cleanup
From: David Westen
Date: Mon Nov 23 2026 - 19:20:45 EST
On 11/22/26 9:17 PM, netdev-bot+sashiko@xxxxxxxxxx wrote:
> [Severity: High]
>
> Does this cancel fully close the use-after-free that the commit message
> describes? When it runs, the netdev TX path, the IRQ handler and the
> ipc_task tasklet are all still live. Any of them can re-arm adb_timer
> before ipc_mux_deinit() frees the MUX.
>
> [...]
>
> There is also a second case. Suppose adb_timer fired just before this
> cancel. hrtimer_cancel() returns once the callback has finished, but the
> ipc_imem_tq_adb_timer_cb entry that the callback queued (wait=false) is
> still sitting in the ipc_task queue.
>
> [...]
>
> Would it make sense to stop the producers (netif TX, the IRQ and the
> tasklet) before ipc_mux_deinit(), and cancel adb_timer after that point or
> add a second cancel there? Two other options would be to skip
> ipc_imem_adb_timer_start() once teardown has begun, and to keep
> ipc_imem_tq_adb_timer_cb() from using a stale ipc_imem->mux.
It doesn't fully close the use-after-free. TX, the MSI handler and the
tasklet can all start the timer again after the cancel, and a callback
that ran just before it can leave a task in the queue. The race is
older than this series: unbind and hibernation run the same teardown.
With the next patch, though, it happens on every S3 suspend.
v3 will keep the timer from being re-armed once teardown has begun, and
make sure no queued task runs on the freed MUX.
Thanks,
David