[PATCH] ASoC: intel: atom: SST: log the byte-stream message header before handing it to the dispatch queue (uaf read of struct ipc_post)
From: Hanxiang Xu
Date: Tue Dec 01 2026 - 21:43:50 EST
sst_send_byte_stream_mrfld() hands its struct ipc_post to the
dispatch queue with sst_add_to_dispatch_list_and_post() and then keeps
dereferencing the local msg pointer in a dev_dbg(). Ownership was
transferred at hand-off: sst_post_message_mrfld() kfree()s the message
it dequeues before returning, so with dynamic debug enabled for this
callsite every byte-control/mixer parameter write to the SST DSP is a
use-after-free read of the freed header; with the IPCX register busy
the free happens from the done-interrupt workqueue instead, racing
the read. sst_prepare_and_post_msg() logs the same header before
posting - this callsite is the odd one out.
Log the header before the hand-off and never touch msg after
sst_add_to_dispatch_list_and_post().
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Hanxiang Xu <xuhx@xxxxxxxxxxx>
---
1 file changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/intel/atom/sst/sst_stream.c b/sound/soc/intel/atom/sst/sst_stream.c
index 288221d..1bc0147 100644
--- a/sound/soc/intel/atom/sst/sst_stream.c
+++ b/sound/soc/intel/atom/sst/sst_stream.c
@@ -200,9 +200,9 @@
}
}
- sst_add_to_dispatch_list_and_post(sst_drv_ctx, msg);
dev_dbg(sst_drv_ctx->dev, "msg->mrfld_header.p.header_low_payload:%d",
msg->mrfld_header.p.header_low_payload);
+ sst_add_to_dispatch_list_and_post(sst_drv_ctx, msg);
if (bytes_block) {
ret = sst_wait_timeout(sst_drv_ctx, block);
--
2.43.0