From: Takashi Iwai <tiwai@suse.de>
To: Hanxiang Xu <xuhx@hust.edu.cn>
Cc: Takashi Iwai <tiwai@suse.com>, Jaroslav Kysela <perex@perex.cz>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ALSA: ctxfi: wait for a running system-timer callback in the free path
Date: Tue, 01 Dec 2026 09:02:35 +0100 [thread overview]
Message-ID: <87wlptzaw4.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261126202600.1-1-xuhx@hust.edu.cn>
On Thu, 26 Nov 2026 13:25:18 +0100,
Hanxiang Xu wrote:
>
> Currently, ct_systimer_free is aliased to ct_systimer_prepare, which
> calls timer_delete_sync_try(). While ct_systimer_prepare() must remain
> non-sleeping because it can run under the PCM stream lock, using
> timer_delete_sync_try() in the free path is unsafe: if the timer
> callback is concurrently running on another CPU, timer_delete_sync_try()
> returns -1 without waiting for completion. The caller then proceeds to
> free the ct_timer_instance object, resulting in a use-after-free in the
> still-running timer callback.
>
> Replace the ct_systimer_free macro with a dedicated function that calls
> timer_shutdown_sync(), which waits for any running callback to finish
> and prevents the timer from being rearmed before the instance is freed.
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hanxiang Xu <xuhx@hust.edu.cn>
Applied now. Thanks.
Takashi
prev parent reply other threads:[~2026-12-01 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 12:25 [PATCH v2] ALSA: ctxfi: wait for a running system-timer callback in the free path Hanxiang Xu
2026-11-26 12:52 ` sashiko-bot
2026-12-01 8:02 ` Takashi Iwai [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=87wlptzaw4.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=xuhx@hust.edu.cn \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox