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: clear the compress drain callbacks on close and gate them on the stream status (uaf of snd_compr_stream)
Date: Wed, 02 Dec 2026 02:59:24 +0000 [thread overview]
Message-ID: <sashiko-outbox-244738@kernel.org> (raw)
In-Reply-To: <20261202021739.1-1-xuhx@hust.edu.cn>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ASoC: intel: atom: missing Fixes trailer in commit message
--
commit 8b22e969b6edb39c81e25e25be00f9bd0eddc9fb
Author: Hanxiang Xu <xuhx@hust.edu.cn>
> ASoC: intel: atom: SST: clear the compress drain callbacks on close and gate them on the stream status (uaf of snd_compr_stream)
>
> sst_cdev_open() registers four callbacks into the persistent DSP
> stream slot, but sst_cdev_close() clears only the compr_cb pair and
> leaves drain_notify/drain_cb_param armed, and never clears the slot's
> pipe_id. process_fw_async_msg() dispatches IPC_IA_DRAIN_STREAM_MRFLD
> purely on "pipe_id matches, drain_notify != NULL" with no status
> check, so a drain completion that arrives after the close path has
> run snd_compr_free() - which kfrees the runtime and the
> snd_compr_file containing the cstream - is dispatched as
> sst_drain_notify(cstream) -> snd_compr_drain_notify(), writing the
> freed cstream->runtime->state and waking the freed runtime->sleep.
> SST implements non-blocking drain, so "drain, then close while the
> firmware is still draining" is a routine user sequence, and nothing
> synchronizes the threaded IRQ on this path.
>
> Clear all four callbacks plus pipe_id in sst_cdev_close() and drain
> in-flight completions with synchronize_irq(ctx->irq_num) before
> returning; gate the DRAIN branch on STREAM_RUNNING like the
> PERIOD_ELAPSED branch already does.
>
> Also reproduced on 7.4.0-rc5: 104 slab-use-after-free reports
> (49 in sst_drain_notify itself) with a KASAN kernel; negative control
> (callbacks never armed) clean.
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hanxiang Xu <xuhx@hust.edu.cn>
[Severity: Low]
Since this fixes the missing drain callback cleanup in sst_cdev_close() and
is tagged for stable, should it include a Fixes: tag?
Fixes: 7adab122a57c ("ASoC: Intel: sst - add compressed ops handling")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202021739.1-1-xuhx@hust.edu.cn?part=1
prev parent reply other threads:[~2026-12-02 2:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 18:17 [PATCH] ASoC: intel: atom: SST: clear the compress drain callbacks on close and gate them on the stream status (uaf of snd_compr_stream) Hanxiang Xu
2026-12-02 2:59 ` 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-244738@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