All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Westen <davidlwesten@gmail.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, loic.poulain@oss.qualcomm.com,
	ryazanov.s.a@gmail.com, johannes@sipsolutions.net,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com,
	m.chetan.kumar@linux.intel.com, linux-kernel@vger.kernel.org,
	mail@maciej.szmigiero.name, nihaal@cse.iitm.ac.in,
	stable@vger.kernel.org
Subject: Re: [PATCH net v2 1/2] net: wwan: iosm: cancel the ADB timer on cleanup
Date: Mon, 23 Nov 2026 16:20:36 -0800	[thread overview]
Message-ID: <b18b3bfc-d95b-4538-b5e0-0fcd5200e69d@gmail.com> (raw)
In-Reply-To: <179541106939.3135.3810191786366936844@kernel.org>

On 11/22/26 9:17 PM, netdev-bot+sashiko@kernel.org 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


      reply	other threads:[~2026-11-24  0:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  4:27 [PATCH net v2 1/2] net: wwan: iosm: cancel the ADB timer on cleanup David Westen
2026-11-19  4:27 ` [PATCH net v2 2/2] net: wwan: iosm: fix S3 resume by re-binding the driver around it David Westen
2026-11-22 20:01   ` Maciej S. Szmigiero
2026-11-23  3:17     ` David Westen
2026-11-23 18:07       ` Maciej S. Szmigiero
2026-11-23  5:17   ` netdev-bot+sashiko
2026-11-24  0:44     ` David Westen
2026-11-23  5:17 ` [PATCH net v2 1/2] net: wwan: iosm: cancel the ADB timer on cleanup netdev-bot+sashiko
2026-11-24  0:20   ` David Westen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b18b3bfc-d95b-4538-b5e0-0fcd5200e69d@gmail.com \
    --to=davidlwesten@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=m.chetan.kumar@linux.intel.com \
    --cc=mail@maciej.szmigiero.name \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nihaal@cse.iitm.ac.in \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.