From: sashiko-bot@kernel.org
To: "Hanxiang Xu" <xuhx@hust.edu.cn>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH] ASoC: intel: atom: SST: sync the DSP threaded IRQ against the PCM close path (uaf of sst_runtime_stream and snd_pcm_runtime)
Date: Wed, 02 Dec 2026 02:53:29 +0000 [thread overview]
Message-ID: <sashiko-outbox-244734@kernel.org> (raw)
In-Reply-To: <20261202021639.1-1-xuhx@hust.edu.cn>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] ASoC: intel: atom: NULL pointer dereference in
sst_media_close() [1]
--
commit a2f8411a02b3eded3b6e9cfa2cd597b87af64776
Author: Hanxiang Xu <xuhx@hust.edu.cn>
ASoC: intel: atom: SST: sync the DSP threaded IRQ against the PCM close path (uaf of sst_runtime_stream and snd_pcm_runtime)
This commit synchronizes the DSP threaded IRQ handler with the PCM stream
close path and gates PERIOD_ELAPSED handling on STREAM_RUNNING to prevent
use-after-free on sst_runtime_stream and snd_pcm_runtime.
> diff --git a/sound/soc/intel/atom/sst-mfld-platform-pcm.c b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> index bbd43d1b5bfa3..f0ec299a34df5 100644
> --- a/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> +++ b/sound/soc/intel/atom/sst-mfld-platform-pcm.c
> @@ -361,6 +361,7 @@ static void sst_media_close(struct snd_pcm_substream *substream,
> if (str_id)
> stream->ops->close(sst->dev, str_id);
> module_put(sst->dev->driver->owner);
> + substream->runtime->private_data = NULL;
[Severity: High]
This problem wasn't introduced by this patch, but can sst_media_close() and
power_down_sst() trigger a NULL pointer dereference on sst [1] if an
active PCM stream is closed after the DSP device is unbound?
When the DSP device is unbound, sst_unregister_dsp() clears the global sst
pointer to NULL while the ALSA card remains registered. If userspace then
closes an open stream, power_down_sst() and sst_media_close() dereference
sst->dev without checking sst or holding sst_lock.
[1] https://sashiko.dev/#/bug/linux-8e69848a-8b71-4130-b540-29b3c6f2eb39
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202021639.1-1-xuhx@hust.edu.cn?part=1
prev parent reply other threads:[~2026-12-02 2:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 18:16 [PATCH] ASoC: intel: atom: SST: sync the DSP threaded IRQ against the PCM close path (uaf of sst_runtime_stream and snd_pcm_runtime) Hanxiang Xu
2026-12-02 2:53 ` sashiko-bot [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=sashiko-outbox-244734@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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